Skip to content

[FrameworkBundle][WebProfilerBundle] fix the upgrade instructions and trigger deprecations #60290

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 54 additions & 50 deletions UPGRADE-7.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
--------------
Expand Down Expand Up @@ -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
--------

Expand Down Expand Up @@ -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
--------

Expand Down
27 changes: 27 additions & 0 deletions src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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' => '.+'])
Expand Down
27 changes: 27 additions & 0 deletions src/Symfony/Bundle/WebProfilerBundle/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading