We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a0d6bb0 commit 46c6c02Copy full SHA for 46c6c02
http_cache.rst
@@ -95,14 +95,19 @@ caching kernel:
95
96
// public/index.php
97
98
- use App\Kernel;
99
+ use App\CacheKernel;
+ use App\Kernel;
100
101
// ...
102
- $kernel = new Kernel($_SERVER['APP_ENV'] ?? 'dev', $_SERVER['APP_DEBUG'] ?? ('prod' !== ($_SERVER['APP_ENV'] ?? 'dev')));
+ $env = $_SERVER['APP_ENV'] ?? 'dev';
103
+ $debug = (bool) ($_SERVER['APP_DEBUG'] ?? ('prod' !== $env));
104
+ // ...
105
+ $kernel = new Kernel($env, $debug);
106
- + // Wrap the default Kernel with the CacheKernel one
- + $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
+ + }
111
112
$request = Request::createFromGlobals();
113
0 commit comments