Update Cache\FileCache
This commit is contained in:
parent
9410dba830
commit
268eff0760
1 changed files with 2 additions and 2 deletions
|
@ -30,7 +30,7 @@ class FileCache implements CacheInterface
|
|||
|
||||
public function __construct(string $dir)
|
||||
{
|
||||
$dir = \rtrim($dir, '/');
|
||||
$dir = \rtrim($dir, '\\/');
|
||||
|
||||
if (empty($dir)) {
|
||||
throw new CacheException('Cache directory unset');
|
||||
|
@ -119,8 +119,8 @@ class FileCache implements CacheInterface
|
|||
$dir = new RecursiveDirectoryIterator($this->cacheDir, RecursiveDirectoryIterator::SKIP_DOTS);
|
||||
$iterator = new RecursiveIteratorIterator($dir);
|
||||
$files = new RegexIterator($iterator, '%\.php$%i', RegexIterator::MATCH);
|
||||
$result = true;
|
||||
|
||||
$result = true;
|
||||
foreach ($files as $file) {
|
||||
$result = \unlink($file->getPathname()) && $result;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue