Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 214e5df

Browse files
committed
minor #19738 [DependencyInjection] Updating prepend extension capabilities (yceruto)
This PR was merged into the 7.1 branch. Discussion ---------- [DependencyInjection] Updating prepend extension capabilities Fixes #19735 I'm also suggesting removing the append example in the prepend extension method. As explained in PR symfony/symfony#52843 and related issues, it's flawed and should be discouraged from the official documentation. I'll create a new PR to target the lower branch and remove it there too. Commits ------- 25c5adf Updating prepend extension capabilities
2 parents a58dccf + 25c5adf commit 214e5df

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

bundles/prepend_extension.rst

+9
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,22 @@ method::
171171
$containerBuilder->prependExtensionConfig('framework', [
172172
'cache' => ['prefix_seed' => 'foo/bar'],
173173
]);
174+
175+
// prepend config from a file
176+
$containerConfigurator->import('../config/packages/cache.php');
174177
}
175178
}
176179

177180
.. note::
178181

179182
The ``prependExtension()`` method, like ``prepend()``, is called only at compile time.
180183

184+
.. deprecated:: 7.1
185+
186+
The :method:`Symfony\\Component\\DependencyInjection\\Loader\\Configurator\\ContainerConfigurator::import`
187+
method behavior was modified in Symfony 7.1 to prepend config instead of appending. This behavior change only
188+
affects to the ``prependExtension()`` method.
189+
181190
Alternatively, you can use the ``prepend`` parameter of the
182191
:method:`Symfony\\Component\\DependencyInjection\\Loader\\Configurator\\ContainerConfigurator::extension`
183192
method::

0 commit comments

Comments
 (0)