Skip to content

Commit dd80b55

Browse files
committed
minor #20923 Add PHP config support for routing (alamirault)
This PR was merged into the 7.3 branch. Discussion ---------- Add PHP config support for routing Fix #20921 I added type `php` exlicitly. I think perf are better, (PhpFileLoader is used). Tell me if it's ok or not Commits ------- 40a99ac Add PHP config support for routing
2 parents 1941db7 + 40a99ac commit dd80b55

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

configuration/micro_kernel_trait.rst

+8-2
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,8 @@ Now it looks like this::
297297
{
298298
// import the WebProfilerRoutes, only if the bundle is enabled
299299
if (isset($this->bundles['WebProfilerBundle'])) {
300-
$routes->import('@WebProfilerBundle/Resources/config/routing/wdt.xml')->prefix('/_wdt');
301-
$routes->import('@WebProfilerBundle/Resources/config/routing/profiler.xml')->prefix('/_profiler');
300+
$routes->import('@WebProfilerBundle/Resources/config/routing/wdt.php', 'php')->prefix('/_wdt');
301+
$routes->import('@WebProfilerBundle/Resources/config/routing/profiler.php', 'php')->prefix('/_profiler');
302302
}
303303

304304
// load the routes defined as PHP attributes
@@ -310,6 +310,12 @@ Now it looks like this::
310310
// to override the default locations for these directories
311311
}
312312

313+
314+
.. versionadded:: 7.3
315+
316+
The ``wdt.php`` and ``profiler.php`` files were introduced in Symfony 7.3.
317+
Previously, you had to import ``wdt.xml`` and ``profiler.xml``
318+
313319
Before continuing, run this command to add support for the new dependencies:
314320

315321
.. code-block:: terminal

controller/error_pages.rst

+9-3
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ automatically when installing ``symfony/framework-bundle``):
154154
# config/routes/framework.yaml
155155
when@dev:
156156
_errors:
157-
resource: '@FrameworkBundle/Resources/config/routing/errors.xml'
157+
resource: '@FrameworkBundle/Resources/config/routing/errors.php'
158+
type: php
158159
prefix: /_error
159160
160161
.. code-block:: xml
@@ -167,7 +168,7 @@ automatically when installing ``symfony/framework-bundle``):
167168
https://symfony.com/schema/routing/routing-1.0.xsd">
168169
169170
<when env="dev">
170-
<import resource="@FrameworkBundle/Resources/config/routing/errors.xml" prefix="/_error"/>
171+
<import resource="@FrameworkBundle/Resources/config/routing/errors.php" type="php" prefix="/_error"/>
171172
</when>
172173
</routes>
173174
@@ -178,7 +179,7 @@ automatically when installing ``symfony/framework-bundle``):
178179
179180
return function (RoutingConfigurator $routes): void {
180181
if ('dev' === $routes->env()) {
181-
$routes->import('@FrameworkBundle/Resources/config/routing/errors.xml')
182+
$routes->import('@FrameworkBundle/Resources/config/routing/errors.php', 'php')
182183
->prefix('/_error')
183184
;
184185
}
@@ -191,6 +192,11 @@ need to replace ``http://localhost/`` by the host used in your local setup):
191192
* ``http://localhost/_error/{statusCode}`` for HTML
192193
* ``http://localhost/_error/{statusCode}.{format}`` for any other format
193194

195+
.. versionadded:: 7.3
196+
197+
The ``errors.php`` file was introduced in Symfony 7.3.
198+
Previously, you had to import ``errors.xml``
199+
194200
.. _overriding-non-html-error-output:
195201

196202
Overriding Error output for non-HTML formats

0 commit comments

Comments
 (0)