mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-27 04:28:44 +02:00
N°8834 - Add compatibility with PHP 8.4 (#819)
* N°8834 - Add compatibility with PHP 8.4 * Rollback of scssphp/scssphp version upgrade due to compilation error
This commit is contained in:
@@ -45,7 +45,7 @@ class Store implements StoreInterface
|
||||
{
|
||||
$this->root = $root;
|
||||
if (!is_dir($this->root) && !@mkdir($this->root, 0777, true) && !is_dir($this->root)) {
|
||||
throw new \RuntimeException(sprintf('Unable to create the store directory (%s).', $this->root));
|
||||
throw new \RuntimeException(\sprintf('Unable to create the store directory (%s).', $this->root));
|
||||
}
|
||||
$this->keyCache = new \SplObjectStorage();
|
||||
$this->options = array_merge([
|
||||
@@ -211,13 +211,9 @@ class Store implements StoreInterface
|
||||
|
||||
// read existing cache entries, remove non-varying, and add this one to the list
|
||||
$entries = [];
|
||||
$vary = $response->headers->get('vary');
|
||||
$vary = implode(', ', $response->headers->all('vary'));
|
||||
foreach ($this->getMetadata($key) as $entry) {
|
||||
if (!isset($entry[1]['vary'][0])) {
|
||||
$entry[1]['vary'] = [''];
|
||||
}
|
||||
|
||||
if ($entry[1]['vary'][0] != $vary || !$this->requestsMatch($vary ?? '', $entry[0], $storedEnv)) {
|
||||
if (!$this->requestsMatch($vary ?? '', $entry[0], $storedEnv)) {
|
||||
$entries[] = $entry;
|
||||
}
|
||||
}
|
||||
@@ -285,7 +281,7 @@ class Store implements StoreInterface
|
||||
*/
|
||||
private function requestsMatch(?string $vary, array $env1, array $env2): bool
|
||||
{
|
||||
if (empty($vary)) {
|
||||
if ('' === ($vary ?? '')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -474,7 +470,7 @@ class Store implements StoreInterface
|
||||
/**
|
||||
* Restores a Response from the HTTP headers and body.
|
||||
*/
|
||||
private function restoreResponse(array $headers, string $path = null): ?Response
|
||||
private function restoreResponse(array $headers, ?string $path = null): ?Response
|
||||
{
|
||||
$status = $headers['X-Status'][0];
|
||||
unset($headers['X-Status']);
|
||||
|
||||
Reference in New Issue
Block a user