diff --git a/UPGRADE-7.3.md b/UPGRADE-7.3.md index 18d84c9fd759d..77a3f14c3445b 100644 --- a/UPGRADE-7.3.md +++ b/UPGRADE-7.3.md @@ -79,29 +79,31 @@ FrameworkBundle * The XML routing configuration files (`errors.xml` and `webhook.xml`) are deprecated, use their PHP equivalent ones: - *Before* - ```yaml - when@dev: - _errors: - resource: '@FrameworkBundle/Resources/config/routing/errors.xml' - prefix: /_error + Before: - webhook: - resource: '@FrameworkBundle/Resources/config/routing/webhook.xml' - prefix: /webhook - ``` + ```yaml + when@dev: + _errors: + resource: '@FrameworkBundle/Resources/config/routing/errors.xml' + prefix: /_error - *After* - ```yaml - when@dev: - _errors: - resource: '@FrameworkBundle/Resources/config/routing/errors.php' - prefix: /_error + webhook: + resource: '@FrameworkBundle/Resources/config/routing/webhook.xml' + prefix: /webhook + ``` - webhook: - resource: '@FrameworkBundle/Resources/config/routing/webhook.php' - prefix: /webhook - ``` + After: + + ```yaml + when@dev: + _errors: + resource: '@FrameworkBundle/Resources/config/routing/errors.php' + prefix: /_error + + webhook: + resource: '@FrameworkBundle/Resources/config/routing/webhook.php' + prefix: /webhook + ``` HttpFoundation -------------- @@ -139,36 +141,6 @@ PropertyInfo * Deprecate the `PropertyTypeExtractorInterface::getTypes()` method, use `PropertyTypeExtractorInterface::getType()` instead * Deprecate the `ConstructorArgumentTypeExtractorInterface::getTypesFromConstructor()` method, use `ConstructorArgumentTypeExtractorInterface::getTypeFromConstructor()` instead -Routing -------- - - * The XML routing configuration files (`profiler.xml` and `wdt.xml`) are - deprecated, use their PHP equivalent ones: - - *Before* - ```yaml - when@dev: - web_profiler_wdt: - resource: '@WebProfilerBundle/Resources/config/routing/wdt.xml' - prefix: /_wdt - - web_profiler_profiler: - resource: '@WebProfilerBundle/Resources/config/routing/profiler.xml' - prefix: /_profiler - ``` - - *After* - ```yaml - when@dev: - web_profiler_wdt: - resource: '@WebProfilerBundle/Resources/config/routing/wdt.php' - prefix: /_wdt - - web_profiler_profiler: - resource: '@WebProfilerBundle/Resources/config/routing/profiler.php - prefix: /_profiler - ``` - Security -------- @@ -307,6 +279,38 @@ VarExporter * Deprecate `LazyGhostTrait` and `LazyProxyTrait`, use native lazy objects instead * Deprecate `ProxyHelper::generateLazyGhost()`, use native lazy objects instead +WebProfilerBundle +----------------- + + * The XML routing configuration files (`profiler.xml` and `wdt.xml`) are + deprecated, use their PHP equivalent ones: + + Before: + + ```yaml + when@dev: + web_profiler_wdt: + resource: '@WebProfilerBundle/Resources/config/routing/wdt.xml' + prefix: /_wdt + + web_profiler_profiler: + resource: '@WebProfilerBundle/Resources/config/routing/profiler.xml' + prefix: /_profiler + ``` + + After: + + ```yaml + when@dev: + web_profiler_wdt: + resource: '@WebProfilerBundle/Resources/config/routing/wdt.php' + prefix: /_wdt + + web_profiler_profiler: + resource: '@WebProfilerBundle/Resources/config/routing/profiler.php + prefix: /_profiler + ``` + Workflow -------- diff --git a/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md b/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md index 40289cf57ddde..935479f485358 100644 --- a/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md +++ b/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md @@ -5,6 +5,33 @@ CHANGELOG --- * Add `errors.php` and `webhook.php` routing configuration files (use them instead of their XML equivalent) + + Before: + + ```yaml + when@dev: + _errors: + resource: '@FrameworkBundle/Resources/config/routing/errors.xml' + prefix: /_error + + webhook: + resource: '@FrameworkBundle/Resources/config/routing/webhook.xml' + prefix: /webhook + ``` + + After: + + ```yaml + when@dev: + _errors: + resource: '@FrameworkBundle/Resources/config/routing/errors.php' + prefix: /_error + + webhook: + resource: '@FrameworkBundle/Resources/config/routing/webhook.php' + prefix: /webhook + ``` + * Add support for the ObjectMapper component * Add support for assets pre-compression * Rename `TranslationUpdateCommand` to `TranslationExtractCommand` diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/routing/errors.php b/src/Symfony/Bundle/FrameworkBundle/Resources/config/routing/errors.php index 11040e29a7e6d..36a46dee407ea 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/routing/errors.php +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/routing/errors.php @@ -10,8 +10,19 @@ */ use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator; +use Symfony\Component\Routing\Loader\XmlFileLoader; return function (RoutingConfigurator $routes): void { + foreach (debug_backtrace() as $trace) { + if (isset($trace['object']) && $trace['object'] instanceof XmlFileLoader && 'doImport' === $trace['function']) { + if (__DIR__ === dirname(realpath($trace['args'][3]))) { + trigger_deprecation('symfony/routing', '7.3', 'The "errors.xml" routing configuration file is deprecated, import "errors.php" instead.'); + + break; + } + } + } + $routes->add('_preview_error', '/{code}.{_format}') ->controller('error_controller::preview') ->defaults(['_format' => 'html']) diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/routing/webhook.php b/src/Symfony/Bundle/FrameworkBundle/Resources/config/routing/webhook.php index 413fe6c817119..ea80311599fa0 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/routing/webhook.php +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/routing/webhook.php @@ -10,8 +10,19 @@ */ use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator; +use Symfony\Component\Routing\Loader\XmlFileLoader; return function (RoutingConfigurator $routes): void { + foreach (debug_backtrace() as $trace) { + if (isset($trace['object']) && $trace['object'] instanceof XmlFileLoader && 'doImport' === $trace['function']) { + if (__DIR__ === dirname(realpath($trace['args'][3]))) { + trigger_deprecation('symfony/routing', '7.3', 'The "webhook.xml" routing configuration file is deprecated, import "webhook.php" instead.'); + + break; + } + } + } + $routes->add('_webhook_controller', '/{type}') ->controller('webhook_controller::handle') ->requirements(['type' => '.+']) diff --git a/src/Symfony/Bundle/WebProfilerBundle/CHANGELOG.md b/src/Symfony/Bundle/WebProfilerBundle/CHANGELOG.md index 6243330cff55d..5e5e8db36e233 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/CHANGELOG.md +++ b/src/Symfony/Bundle/WebProfilerBundle/CHANGELOG.md @@ -5,6 +5,33 @@ CHANGELOG --- * Add `profiler.php` and `wdt.php` routing configuration files (use them instead of their XML equivalent) + + Before: + + ```yaml + when@dev: + web_profiler_wdt: + resource: '@WebProfilerBundle/Resources/config/routing/wdt.xml' + prefix: /_wdt + + web_profiler_profiler: + resource: '@WebProfilerBundle/Resources/config/routing/profiler.xml' + prefix: /_profiler + ``` + + After: + + ```yaml + when@dev: + web_profiler_wdt: + resource: '@WebProfilerBundle/Resources/config/routing/wdt.php' + prefix: /_wdt + + web_profiler_profiler: + resource: '@WebProfilerBundle/Resources/config/routing/profiler.php + prefix: /_profiler + ``` + * Add `ajax_replace` option for replacing toolbar on AJAX requests 7.2