Skip to content

[FrameworkBundle] Allow XML configuration in config/packages by default #45167

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

Closed
wants to merge 5 commits into from
Closed

Conversation

ro0NL
Copy link
Contributor

@ro0NL ro0NL commented Jan 25, 2022

Q A
Branch? 6.1
Bug fix? no
New feature? yes
Deprecations? no
Tickets follow up of #44503
License MIT
Doc PR TODO

@derrabus
Copy link
Member

Let me fix that table for you. 🙃

$routes->import($configDir.'/{routes}/'.$this->environment.'/*.{php,yaml}');
$routes->import($configDir.'/{routes}/*.{php,yaml}');
$routes->import($configDir.'/{routes}/'.$this->environment.'/*.{php,xml,yaml}');
$routes->import($configDir.'/{routes}/*.{php,xml,yaml}');

if (is_file($configDir.'/routes.yaml')) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm not mistaking shouldn't this case be covered as well?

Copy link
Contributor Author

@ro0NL ro0NL Jan 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new feature IMHO, previous PR explicitly targeted config/packages. I follow :)

changelog updated +1

sorry, i missed the else case.

@nicolas-grekas WDYT?

Copy link
Contributor Author

@ro0NL ro0NL Jan 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ideally i'd like this to be simple as $routes->import($configDir.'/routes.{php,xml,yaml}');

for services we could phase out services_<env>.ext in favor when@<env> notation IIUC.

Then everything is uniform IMHO.

@ro0NL
Copy link
Contributor Author

ro0NL commented Jan 25, 2022

i think @HypeMC's comment is valid, and this PR is a rabbit-hole :)

i may very vell rewrite xml to php once we upgrade to 6.x :} thus not bothering you with out-of-the-box xml support or so.

@ro0NL ro0NL closed this Jan 25, 2022
@ro0NL ro0NL deleted the patch-1 branch January 25, 2022 19:06
@fabpot
Copy link
Member

fabpot commented Jan 26, 2022

Maybe it’s time to deprecate XML support?

@ro0NL
Copy link
Contributor Author

ro0NL commented Jan 26, 2022

@fabpot i let you decide .. maybe we miss its purpose :)

generally we could have many formats, personally i'd aim for a more consise solution, eg.

$c->import($configDir.'/services.{php,xml,yaml}');
$c->import($configDir.'/{packages}/*.{php,xml,yaml}');
$c->import($configDir.'/{packages}/'.$this->environment.'/*.{php,xml,yaml}');

$r->import($configDir.'/routes.{php,xml,yaml}');
$r->import($configDir.'/routes/<env>/*.{php,xml,yaml}');
  • no special services_<env>.ext file
  • easy format maintenance at the glob pattern level, in alpha order 🤷

Then, to make it waterproof we could forbid some.php + some.yaml 🤷

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

Successfully merging this pull request may close these issues.

6 participants