@@ -31,10 +31,10 @@ discard block |
||
31 | 31 | |
32 | 32 | /** |
33 | 33 | * @param bool|string[] $cacheQueryString Whether to take the URL query string into consideration when generating output cache files. |
34 | - * Valid options are: |
|
34 | + * Valid options are: |
|
35 | 35 | * false = Disabled |
36 | 36 | * true = Enabled, take all query parameters into account. |
37 | - * Please be aware that this may result in numerous cache |
|
37 | + * Please be aware that this may result in numerous cache |
|
38 | 38 | * files generated for the same page over and over again. |
39 | 39 | * array('q') = Enabled, but only take into account the specified list of query parameters. |
40 | 40 | */ |
@@ -58,12 +58,12 @@ discard block |
||
58 | 58 | { |
59 | 59 | $uri = clone $request->getUri(); |
60 | 60 | |
61 | - // @todo implementation de la recuperation des queriestring |
|
61 | + // @todo implementation de la recuperation des queriestring |
|
62 | 62 | /* $query = $this->cacheQueryString |
63 | 63 | ? $uri->getQuery(is_array($this->cacheQueryString) ? ['only' => $this->cacheQueryString] : []) |
64 | 64 | : ''; */ |
65 | 65 | |
66 | - $query = ''; |
|
66 | + $query = ''; |
|
67 | 67 | |
68 | 68 | return md5($uri->withFragment('')->withQuery($query)); |
69 | 69 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | return true; |
78 | 78 | } |
79 | 79 | |
80 | - $headers = []; |
|
80 | + $headers = []; |
|
81 | 81 | |
82 | 82 | foreach (array_keys($response->getHeaders()) as $header) { |
83 | 83 | $headers[$header] = $response->getHeaderLine($header); |
@@ -95,17 +95,17 @@ discard block |
||
95 | 95 | */ |
96 | 96 | public function get(ServerRequestInterface $request, ResponseInterface $response): ?ResponseInterface |
97 | 97 | { |
98 | - if ($cachedResponse = $this->cache->get($this->generateCacheKey($request))) { |
|
98 | + if ($cachedResponse = $this->cache->get($this->generateCacheKey($request))) { |
|
99 | 99 | $cachedResponse = unserialize($cachedResponse); |
100 | 100 | |
101 | - if (! is_array($cachedResponse) || ! isset($cachedResponse['output']) || ! isset($cachedResponse['headers'])) { |
|
101 | + if (! is_array($cachedResponse) || ! isset($cachedResponse['output']) || ! isset($cachedResponse['headers'])) { |
|
102 | 102 | throw new Exception('Erreur lors de la désérialisation du cache de page'); |
103 | 103 | } |
104 | 104 | |
105 | 105 | $headers = $cachedResponse['headers']; |
106 | 106 | $output = $cachedResponse['output']; |
107 | 107 | |
108 | - // Effacer tous les en-têtes par défaut |
|
108 | + // Effacer tous les en-têtes par défaut |
|
109 | 109 | foreach (array_keys($response->getHeaders()) as $key) { |
110 | 110 | $response = $response->withoutHeader($key); |
111 | 111 | } |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | $response = $response->withHeader($name, $value); |
116 | 116 | } |
117 | 117 | |
118 | - return $response->withBody(to_stream($output)); |
|
118 | + return $response->withBody(to_stream($output)); |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | return null; |
@@ -141,10 +141,10 @@ |
||
141 | 141 | throw new InvalidArgumentException('Le gestionnaire de cache doit utiliser BlitzPHP\Cache\Handlers\BaseHandler comme classe de base.'); |
142 | 142 | } |
143 | 143 | |
144 | - if (isset($this->config[$handler]) && is_array($this->config[$handler])) { |
|
145 | - $this->config = array_merge($this->config, $this->config[$handler]); |
|
146 | - unset($this->config[$handler]); |
|
147 | - } |
|
144 | + if (isset($this->config[$handler]) && is_array($this->config[$handler])) { |
|
145 | + $this->config = array_merge($this->config, $this->config[$handler]); |
|
146 | + unset($this->config[$handler]); |
|
147 | + } |
|
148 | 148 | |
149 | 149 | if (! $adapter->init($this->config)) { |
150 | 150 | throw new RuntimeException( |