GithubHelp home page GithubHelp logo

symfony-cmf / resource-bundle Goto Github PK

View Code? Open in Web Editor NEW
5.0 5.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-bundle symfony-cmf

resource-bundle's Issues

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. (?).

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.

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.

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".

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

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!

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

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.