Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import parameters from other subsections as well #35

Open
artur-gajewski opened this issue Oct 14, 2013 · 1 comment
Open

Import parameters from other subsections as well #35

artur-gajewski opened this issue Oct 14, 2013 · 1 comment

Comments

@artur-gajewski
Copy link

If the parameters.yml-dist file has following structure:

parameters:
   login_required: false

twig:
    globals:
        show_forkme: true

Only the parameters section will be checked for missing parameters and imported, but the other sections remain unchecked / unimported. Should also import these.

@annitya
Copy link

annitya commented Nov 25, 2014

For an eZPublish-project we have the following yaml-configuration:

doctrine:
    dbal:
       driver:
       host:
       port:
       dbname:
       user:
       password:
       charset:

All excellent candidates for a dist-file, however the dbal-key is unreachable.
This has led us to the following implementation. Not ideal, duplicate-code considered, but functional:

parameters:
    database_driver: pdo_mysql
    database_port: 3306
    database_charset: UTF8
    database_host: ~
    database_name: ~
    database_user: ~
    database_password: ~
    solr_uri: ~
    http_purge_servers: ~

doctrine:
    dbal:
       driver: %database_driver%
       host: %database_host%
       port: %database_port%
       dbname: %database_name%
       user: %database_user%
       password: %database_password%
       charset: %database_charset%

If it where possible to specify deeper (and perhaps multiple) parameters-keys, much would be solved.
Something along the lines of:

{
    "file" : "app/config/databases.yml",
    "dist-file" : "app/config/databases.dist.yml",
    "parameter-key" : [
        "doctrine/dbal",
        "some/even/deeper/key"
    ]
}

The ParameterHandler could then iterate over the settings found beneath the specified key(s).

Is this something that could work?
@stof

Edit: I would be happy to create a pull-request for this, but first let me know if the approach is viable! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants