From 55430415fe38f35f8d0b6b868f8a4ac0b334c820 Mon Sep 17 00:00:00 2001 From: Dmitrii Derepko Date: Wed, 29 May 2024 02:29:03 +0300 Subject: [PATCH 1/2] Ignore locale middleware for gii controllers --- blog-api/config/common/params.php | 1 + blog/config/web/params.php | 1 + 2 files changed, 2 insertions(+) diff --git a/blog-api/config/common/params.php b/blog-api/config/common/params.php index 98e8d888..ac8b9652 100644 --- a/blog-api/config/common/params.php +++ b/blog-api/config/common/params.php @@ -20,6 +20,7 @@ 'locale' => [ 'locales' => ['en' => 'en-US', 'ru' => 'ru-RU', 'de' => 'de-DE'], 'ignoredRequests' => [ + '/gii**', '/debug**', '/inspect**', ], diff --git a/blog/config/web/params.php b/blog/config/web/params.php index 1d07ac92..a2e8992c 100644 --- a/blog/config/web/params.php +++ b/blog/config/web/params.php @@ -28,6 +28,7 @@ 'locale' => [ 'locales' => ['en' => 'en-US', 'ru' => 'ru-RU', 'id' => 'id-ID', 'sk' => 'sk-SK', 'de' => 'de-DE'], 'ignoredRequests' => [ + '/gii**', '/debug**', '/inspect**', ], From c55fa8b08be7d7f514850f0b84ffbf4e0da62f47 Mon Sep 17 00:00:00 2001 From: Dmitrii Derepko Date: Fri, 14 Jun 2024 14:07:38 +0300 Subject: [PATCH 2/2] Adopt debug --- blog/config/common/di/router.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/blog/config/common/di/router.php b/blog/config/common/di/router.php index 0f7be58c..fcab40c4 100644 --- a/blog/config/common/di/router.php +++ b/blog/config/common/di/router.php @@ -11,7 +11,6 @@ use Yiisoft\Router\RouteCollectionInterface; use Yiisoft\Router\RouteCollectorInterface; use Yiisoft\Router\UrlGeneratorInterface; -use Yiisoft\Yii\Debug\Viewer\Middleware\ToolbarMiddleware; /** * @var Config $config @@ -39,10 +38,6 @@ Group::create()->routes(...$config->get('routes')), ); - if (!str_starts_with(getenv('YII_ENV') ?: '', 'prod')) { - $collector->middleware(ToolbarMiddleware::class); - } - return new RouteCollection($collector); }, ];