Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Simplify configuration registration #21173

Copy link
Copy link
Closed
@theofidry

Description

@theofidry
Issue body actions
Q A
Bug report? no
Feature request? yes
BC Break report? no
RFC? yes
Symfony version master

I guess it's not everyone, but I personally use a lot of configuration files. I like to split them when it makes sense and avoid having config files that are too big. On my last 3 good sized projects (not all from me actually) the average was ~50 files.

I personally find very cumbersome to have to manually include them via config*.yml files, so I've done a small locator which register my config files automatically. It works as follow:

  • scan the config dir to get all the files there
  • filter files: some should not be included at all, e.g. routing and parameters.dist and other are environment specific
  • load each of those files

So you basically have the following:

app/config/
    parameters.yml
    parameters.yml.dist  # ignored (like any `*.dist`)
    routing.yml          # ignored
    security.yml         # included for any environment
    security_prod.yml    # included only for the env `prod`
    framework.yml
    framework_prod.yml
    ...
    services/
        foo.yml
        foo_dev.yml
        foo_prod.yml

I would like to suggest to have that feature directly in the core (I can work on it), WDYT?

/cc DX master @weaverryan

Metadata

Metadata

Assignees

No one assigned

    Labels

    ConfigFeatureRFCRFC = Request For Comments (proposals about features that you want to be discussed)RFC = Request For Comments (proposals about features that you want to be discussed)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.