Skip to content

Commit f3d9257

Browse files
committed
feature #44503 [FrameworkBundle] Allow PHP configuration in config/packages by default (dreadnip)
This PR was squashed before being merged into the 6.1 branch. Discussion ---------- [FrameworkBundle] Allow PHP configuration in config/packages by default | Q | A | ------------- | --- | Branch? | 6.1 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | | License | MIT | Doc PR | - Since the introduction of ConfigBuilders in 5.3, it is way more common for developers to use PHP configuration files in config/packages, yet these config files are still not loaded by default. Having this small change would drastically improve the developer experience for those who prefer working with PHP configuration. I have a doc PR ready but wanted to check first if this is something the maintainers could agree on. Commits ------- 3c76e962cc [FrameworkBundle] Allow PHP configuration in config/packages by default
2 parents 3c1ee94 + 2cfef4b commit f3d9257

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ CHANGELOG
55
---
66

77
* Environment variable `SYMFONY_IDE` is read by default when `framework.ide` config is not set.
8+
* Load PHP configuration files by default in the `MicroKernelTrait`
89

910
6.0
1011
---

Kernel/MicroKernelTrait.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ private function configureContainer(ContainerConfigurator $container, LoaderInte
5050
{
5151
$configDir = $this->getConfigDir();
5252

53-
$container->import($configDir.'/{packages}/*.yaml');
54-
$container->import($configDir.'/{packages}/'.$this->environment.'/*.yaml');
53+
$container->import($configDir.'/{packages}/*.{php,yaml}');
54+
$container->import($configDir.'/{packages}/'.$this->environment.'/*.{php,yaml}');
5555

5656
if (is_file($configDir.'/services.yaml')) {
5757
$container->import($configDir.'/services.yaml');
@@ -74,8 +74,8 @@ private function configureRoutes(RoutingConfigurator $routes): void
7474
{
7575
$configDir = $this->getConfigDir();
7676

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

8080
if (is_file($configDir.'/routes.yaml')) {
8181
$routes->import($configDir.'/routes.yaml');

0 commit comments

Comments
 (0)