From 9225077ec44f45c9db72abcbffa88c98cb2f7373 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Thu, 21 Nov 2024 22:37:50 +0100 Subject: [PATCH] Add Symfony Web Profiler Bundle Integrate Symfony Web Profiler Bundle for improved debugging and profiling in development environment. Updated composer configuration, created necessary configuration files for both packages and routes, and locked the bundle version in symfony.lock file. --- composer.json | 3 ++- config/packages/web_profiler.yaml | 15 +++++++++++++++ config/routes/web_profiler.yaml | 8 ++++++++ symfony.lock | 13 +++++++++++++ 4 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 config/packages/web_profiler.yaml create mode 100644 config/routes/web_profiler.yaml diff --git a/composer.json b/composer.json index d21df006a..f72ad3135 100644 --- a/composer.json +++ b/composer.json @@ -102,7 +102,8 @@ "symfony/phpunit-bridge": "^7.1", "symfony/runtime": "^5.4", "symfony/stopwatch": "^5.4", - "symfony/var-dumper": "^5.4" + "symfony/var-dumper": "^5.4", + "symfony/web-profiler-bundle": "^5.4" }, "conflict": { "symfony/symfony": "*" diff --git a/config/packages/web_profiler.yaml b/config/packages/web_profiler.yaml new file mode 100644 index 000000000..17893da18 --- /dev/null +++ b/config/packages/web_profiler.yaml @@ -0,0 +1,15 @@ +when@dev: + web_profiler: + toolbar: true + intercept_redirects: false + + framework: + profiler: { only_exceptions: false } + +when@test: + web_profiler: + toolbar: false + intercept_redirects: false + + framework: + profiler: { collect: false } diff --git a/config/routes/web_profiler.yaml b/config/routes/web_profiler.yaml new file mode 100644 index 000000000..8d85319fd --- /dev/null +++ b/config/routes/web_profiler.yaml @@ -0,0 +1,8 @@ +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 diff --git a/symfony.lock b/symfony.lock index f11d12438..984d0a726 100644 --- a/symfony.lock +++ b/symfony.lock @@ -362,6 +362,19 @@ "config/packages/validator.yaml" ] }, + "symfony/web-profiler-bundle": { + "version": "5.4", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "5.3", + "ref": "24bbc3d84ef2f427f82104f766014e799eefcc3e" + }, + "files": [ + "config/packages/web_profiler.yaml", + "config/routes/web_profiler.yaml" + ] + }, "symfony/webpack-encore-bundle": { "version": "1.17", "recipe": {