File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -95,14 +95,19 @@ caching kernel:
9595
9696 // public/index.php
9797
98- use App\Kernel;
9998 + use App\CacheKernel;
99+ use App\Kernel;
100100
101101 // ...
102- $kernel = new Kernel($_SERVER['APP_ENV'] ?? 'dev', $_SERVER['APP_DEBUG'] ?? ('prod' !== ($_SERVER['APP_ENV'] ?? 'dev')));
102+ $env = $_SERVER['APP_ENV'] ?? 'dev';
103+ $debug = (bool) ($_SERVER['APP_DEBUG'] ?? ('prod' !== $env));
104+ // ...
105+ $kernel = new Kernel($env, $debug);
103106
104- + // Wrap the default Kernel with the CacheKernel one
105- + $kernel = new CacheKernel($kernel);
107+ + // Wrap the default Kernel with the CacheKernel one in 'prod' environment
108+ + if ('prod' === $env) {
109+ + $kernel = new CacheKernel($kernel);
110+ + }
106111
107112 $request = Request::createFromGlobals();
108113 // ...
You can’t perform that action at this time.
0 commit comments