mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-24 17:22:55 +02:00
[ticket/17535] Address code review comments
PHPBB-17535
This commit is contained in:
46
phpBB/phpbb/cache/driver/base.php
vendored
46
phpBB/phpbb/cache/driver/base.php
vendored
@@ -31,32 +31,32 @@ abstract class base implements \phpbb\cache\driver\driver_interface
|
||||
try
|
||||
{
|
||||
$iterator = new \DirectoryIterator($this->cache_dir);
|
||||
|
||||
foreach ($iterator as $fileInfo)
|
||||
{
|
||||
if ($fileInfo->isDot())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
$filename = $fileInfo->getFilename();
|
||||
if ($fileInfo->isDir())
|
||||
{
|
||||
$this->remove_dir($fileInfo->getPathname());
|
||||
}
|
||||
else if (strpos($filename, 'container_') === 0 ||
|
||||
strpos($filename, 'autoload_') === 0 ||
|
||||
strpos($filename, 'url_matcher') === 0 ||
|
||||
strpos($filename, 'url_generator') === 0 ||
|
||||
strpos($filename, 'sql_') === 0 ||
|
||||
strpos($filename, 'data_') === 0)
|
||||
{
|
||||
$this->remove_file($fileInfo->getPathname());
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($iterator as $fileInfo)
|
||||
{
|
||||
if ($fileInfo->isDot())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
$filename = $fileInfo->getFilename();
|
||||
if ($fileInfo->isDir())
|
||||
{
|
||||
$this->remove_dir($fileInfo->getPathname());
|
||||
}
|
||||
else if (strpos($filename, 'container_') === 0 ||
|
||||
strpos($filename, 'autoload_') === 0 ||
|
||||
strpos($filename, 'url_matcher') === 0 ||
|
||||
strpos($filename, 'url_generator') === 0 ||
|
||||
strpos($filename, 'sql_') === 0 ||
|
||||
strpos($filename, 'data_') === 0)
|
||||
{
|
||||
$this->remove_file($fileInfo->getPathname());
|
||||
}
|
||||
// Do not return, to purge vars cached in memory
|
||||
}
|
||||
|
||||
unset($this->vars);
|
||||
|
Reference in New Issue
Block a user