Re-enabled nesting

This commit is contained in:
Chris 2020-10-11 23:44:36 +02:00
parent 6ffc729cc7
commit 4a066dfd17
1 changed files with 8 additions and 3 deletions

View File

@ -54,8 +54,8 @@ class LocalCache implements CacheInterface
protected function getKeyPath(string $key)
{
$hash = $this->hashKey($key);
// $path = substr($hash, 0, 2) . DIRECTORY_SEPARATOR . substr($hash, 2, 2) . DIRECTORY_SEPARATOR . $hash;
$full = $this->cacheDir . DIRECTORY_SEPARATOR . $this->poolName . DIRECTORY_SEPARATOR . $hash; // $path;
$path = substr($hash, 0, 2) . DIRECTORY_SEPARATOR . substr($hash, 2, 2) . DIRECTORY_SEPARATOR . $hash;
$full = $this->cacheDir . DIRECTORY_SEPARATOR . $this->poolName . DIRECTORY_SEPARATOR . $path;
return $full;
}
@ -125,12 +125,17 @@ class LocalCache implements CacheInterface
*/
public function clear()
{
/*
$items = glob($this->cacheDir.DIRECTORY_SEPARATOR.$this->poolName.DIRECTORY_SEPARATOR."*.info");
foreach ($items as $item) {
unlink(substr($item, 0, -5));
unlink($item);
}
@rmdir($this->cacheDir . DIRECTORY_SEPARATOR . $this->poolName);
*/
$path = $this->cacheDir . DIRECTORY_SEPARATOR . $this->poolName;
exec("rm -rf ".escapeshellarg($path));
}
/**
@ -173,4 +178,4 @@ class LocalCache implements CacheInterface
$this->delete($key);
}
}
}
}