Skip to content

Commit e6619dc

Browse files
committed
Merge branch '5.4' into 6.0
* 5.4: [Config] Add Kernel method override example for php/xml formats add note how to avoid amqp queues autocreation
2 parents 84f576d + d75e3c5 commit e6619dc

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

configuration.rst

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,32 @@ readable. These are the main advantages and disadvantages of each format:
7979
By default Symfony only loads the configuration files defined in YAML
8080
format. If you define configuration in XML and/or PHP formats, update the
8181
``src/Kernel.php`` file to add support for the ``.xml`` and ``.php`` file
82-
extensions.
82+
extensions by overriding the
83+
:method:`Symfony\\Component\\HttpKernel\\Kernel::configureContainer` method::
84+
85+
// src/Kernel.php
86+
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
87+
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
88+
89+
class Kernel extends BaseKernel
90+
{
91+
// ...
92+
93+
private function configureContainer(ContainerConfigurator $container): void
94+
{
95+
$configDir = $this->getConfigDir();
96+
97+
$container->import($configDir.'/{packages}/*.{yaml,php}');
98+
$container->import($configDir.'/{packages}/'.$this->environment.'/*.{yaml,php}');
99+
100+
if (is_file($configDir.'/services.yaml')) {
101+
$container->import($configDir.'/services.yaml');
102+
$container->import($configDir.'/{services}_'.$this->environment.'.yaml');
103+
} else {
104+
$container->import($configDir.'/{services}.php');
105+
}
106+
}
107+
}
83108

84109
Importing Configuration Files
85110
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

messenger.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,6 +1150,7 @@ it in the ``port`` parameter of the DSN (e.g. ``amqps://localhost?cacert=/etc/ss
11501150
By default, the transport will automatically create any exchanges, queues and
11511151
binding keys that are needed. That can be disabled, but some functionality
11521152
may not work correctly (like delayed queues).
1153+
To not autocreate any queues, you can configure a transport with ``queues: []``.
11531154

11541155
.. note::
11551156

0 commit comments

Comments
 (0)