GithubHelp home page GithubHelp logo

symfony-cmf / resource-bundle Goto Github PK

View Code? Open in Web Editor NEW
5.0 4.0 7.0 170 KB

Resource Location for CMF documents based on Puli

Home Page: https://cmf.symfony.com

PHP 97.29% Makefile 2.71%
symfony symfony-cmf symfony-bundle

resource-bundle's Introduction

This repository is no longer maintained

Due to lack of interest, we had to decide to discontinue this repository. The CMF project focusses on the Routing component and RoutingBundle, which are still in active use by other projects.

This repository will no longer be upgraded and marked as abandoned, but will be kept available for legacy projects or if somebody wants to experiment with the CMF.

You can contact us in the #symfony_cmf channel of the Symfony devs slack.

Symfony CMF Resource Bundle

Latest Stable Version Latest Unstable Version License

Total Downloads Monthly Downloads Daily Downloads

Branch Travis Coveralls
master Build Status Coverage Status

This package is part of the Symfony Content Management Framework (CMF) and licensed under the MIT License.

This bundle provides object resource location services based on Puli.

Examples:

  • Static document path mapping: Map the path /routes to /cms/routes
  • Dynamic document resolution: Map the path /routes to /cms/<current site>/routes.
  • Access documents at a static location: Map /role/menu/main to /cms/menus/main-menu.

The first example could use the existing CMF base route configuration to resolve paths.

The benefit of the above two examples would be most strongly felt in association with another component which would provide a context for the document resource resolution.

For example, a Site which is matched against the incoming hostname would provide the context with which to resolve the documents.

Requirements

  • PHP 7.1 / 7.2
  • Symfony 2.8 / 3.3 / 3.4 / 4.0
  • See also the require section of composer.json

Documentation

For the install guide and reference, see:

See also:

Support

For general support and questions, please use StackOverflow.

Contributing

Pull requests are welcome. Please see our CONTRIBUTING guide.

Unit and/or functional tests exist for this package. See the Testing documentation for a guide to running the tests.

Thanks to everyone who has contributed already.

License

This package is available under the MIT license.

resource-bundle's People

Contributors

dantleech avatar dbu avatar electricmaxxx avatar lsmith77 avatar wouterj avatar xabbuh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

resource-bundle's Issues

basepath or base_path also basedir

The CMF currnetly uses basepath to indicate paths in the CR repository. It would follow then that we use basedir to indicate filesystem paths. But I generally think we should always use underscores - base_path and base_dir.

Change repository configuration structure

It would make more sense for the configuration to be:

repository:
    repository_1:
        type: doctrine_phpcr_odm
        basepath: /foo/bar
    repository_2:
        type: filesystem
        basedir: /tmp/foo

Rather than the somewhat inverted:

repository:
    doctrine_phpcr_odm:
        repository_1:
             basepath: /foo/bar

The reason it is as it is is because it allows us to have strict configuration. But .. It also limits the extensibility of the bundle so it is probably better to have loose validation in the DI and strict validation at "runtime".

Resource debug / describe command.

When #29 is merged, then I think it would make sense to add a command for debugging /describing resources, e.g.

$ ./bin/console debug:cmf-resource /path/to/resource --repository=default
name: Foobar
type: phpcr
payload_type: nt:foobar
description:
     link_edit_html: /edit/foobar/1234
     link_list_html: /foobars

Default repository when null specified.

Should the repository registry use a configured default if null is given as the repository name?

The Doctrine connection registry would behave like this.

A default repository

What do you think of configuring a default repository: One that will be used when the repository name parameter is omitted.

At the moment, anything using the ResourceBundle needs to know the repository name. As this name is purely based on the runtime configuration, every bundle needing something from the ResourceBundle is required to have a configuration option for this option.

In the case of the treeBrowserBundle, this would mean that anyone using the tree form type needs to know the repository name.

I think it would be much easier to have a default repository (are there many use-cases for multiple repositories?).

This could be done by either having a convention that the default repository is called default:

cmf_resource:
    repositories:
        default:
            # ...

Or a new option can be added:

cmf_resource:
    default_repository_name: phpcrodm
    repositories:
        phpcrodm:
            # ...

/cc @dantleech

Case where default registry has not been created is not handled.

If no repositories have been configured then the following error is given if the "default" is requested:

You have requested a non-existent service "cmf_resource.repository.default".

It should say that:

  1. The requested repository has not been found (i.e. the error should not come from the container).
  2. The user must define the repository. (?).

Non-existent parameter cmf_resource.repositories.default_name

Environment

PHP 7.3.6

Symfony packages

$ composer show --latest 'symfony/*'

symfony/assetic-bundle        v2.8.2  v2.8.2  Integrates Assetic into Symfony2
Package symfony/assetic-bundle is abandoned, you should avoid using it. Use symfony/webpack-encore-pack instead.
symfony/http-client           v4.3.2  v4.3.2  Symfony HttpClient component
symfony/http-client-contracts v1.1.5  v1.1.5  Generic abstractions related t...
symfony/mime                  v4.3.2  v4.3.2  A library to manipulate MIME m...
symfony/monolog-bundle        v2.12.1 v3.4.0  Symfony MonologBundle
symfony/polyfill-apcu         v1.11.0 v1.11.0 Symfony polyfill backporting a...
symfony/polyfill-ctype        v1.11.0 v1.11.0 Symfony polyfill for ctype fun...
symfony/polyfill-intl-icu     v1.11.0 v1.11.0 Symfony polyfill for intl's IC...
symfony/polyfill-intl-idn     v1.11.0 v1.11.0 Symfony polyfill for intl's id...
symfony/polyfill-mbstring     v1.11.0 v1.11.0 Symfony polyfill for the Mbstr...
symfony/polyfill-php54        v1.11.0 v1.11.0 Symfony polyfill backporting s...
symfony/polyfill-php55        v1.11.0 v1.11.0 Symfony polyfill backporting s...
symfony/polyfill-php56        v1.11.0 v1.11.0 Symfony polyfill backporting s...
symfony/polyfill-php70        v1.11.0 v1.11.0 Symfony polyfill backporting s...
symfony/polyfill-php72        v1.11.0 v1.11.0 Symfony polyfill backporting s...
symfony/polyfill-php73        v1.11.0 v1.11.0 Symfony polyfill backporting s...
symfony/polyfill-util         v1.11.0 v1.11.0 Symfony utilities for portabil...
symfony/security-acl          v3.0.2  v3.0.2  Symfony Security Component - A...
symfony/swiftmailer-bundle    v2.6.7  v3.2.8  Symfony SwiftmailerBundle
symfony/symfony               v2.8.51 v4.3.2  The Symfony PHP framework

Symfony CMF and Sonata packages

$ composer show --latest 'symfony-cmf/*'

symfony-cmf/block-bundle                          2.1.1 2.1.1
symfony-cmf/content-bundle                        2.1.0 2.1.0
symfony-cmf/core-bundle                           2.1.1 2.1.1
symfony-cmf/menu-bundle                           2.2.0 2.2.0
symfony-cmf/resource                              1.1.0 1.1.0
symfony-cmf/resource-bundle                       1.1.0 1.1.0
symfony-cmf/resource-rest-bundle                  1.1.0 1.1.0
symfony-cmf/routing                               2.1.0 2.1.0
symfony-cmf/routing-auto                          2.1.0 2.1.0
symfony-cmf/routing-auto-bundle                   2.1.0 2.1.0
symfony-cmf/routing-bundle                        2.1.1 2.1.1
symfony-cmf/slugifier-api                         2.0.0 2.0.0
symfony-cmf/sonata-phpcr-admin-integration-bundle 1.1.0 1.1.0
symfony-cmf/symfony-cmf                           2.1.0 2.1.0
symfony-cmf/tree-browser-bundle                   2.1.1 2.1.1


$ composer show --latest 'sonata-project/*'

sonata-project/admin-bundle                3.51.0 3.51.0 The missing Symfony Admin Generator
sonata-project/block-bundle                3.15.0 3.15.0 Symfony SonataBlockBundle
sonata-project/cache                       2.0.1  2.0.1  Cache library
sonata-project/core-bundle                 3.17.0 3.17.0 Symfony SonataCoreBundle
sonata-project/datagrid-bundle             2.4.0  3.0.0  Symfony SonataDatagridBundle
sonata-project/doctrine-extensions         1.3.0  1.3.0  Doctrine2 behavioral extensions
sonata-project/doctrine-orm-admin-bundle   3.9.0  3.9.0  Symfony Sonata / Integrate Doctrine ORM into the SonataAdminBundle
sonata-project/doctrine-phpcr-admin-bundle 2.2.0  2.2.0  Symfony Sonata / Integrate Doctrine PHPCR into the SonataAdminBundle
sonata-project/exporter                    2.0.1  2.0.1  Lightweight Exporter library
sonata-project/translation-bundle          2.4.1  2.4.1  SonataTranslationBundle

Hi,

I am updating bundles to switch to symfony 3 but I catch an error:

[Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException]
  The service "sonata.admin.doctrine_phpcr.tree_controller" has a dependency
  on a non-existent parameter "cmf_resource.repositories.default_name".

Where can I set this parameter ?

When I add the parameter into my config file, I get another error.

cmf_resource:
    repositories:
        default:
            type: doctrine/phpcr-odm
 [Symfony\Component\DependencyInjection\Exception\InvalidArgumentException]
  There is no extension able to load the configuration for "cmf_resource"

I don't know where to look ... and the link to the documentation doesn't work:
https://symfony.com/doc/master/cmf/bundles/resource-rest/index.html

I have already reset the cache and reinstall all bundles.

Does someone have an idea?

Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.