1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-06-11 00:40:56 +02:00

[ticket/16354] Reload page after cache purge & purge time limit

PHPBB3-16354
This commit is contained in:
Marc Alexander
2020-01-22 20:14:28 +01:00
parent 54ab1f1e80
commit 5fb5228591

View File

@ -132,10 +132,22 @@ function installer_shutdown_function($display_errors)
$cache = new \phpbb\cache\driver\file(__DIR__ . '/../cache/installer'); $cache = new \phpbb\cache\driver\file(__DIR__ . '/../cache/installer');
if (strpos($error['file'], realpath($cache->cache_dir)) !== false) if (strpos($error['file'], realpath($cache->cache_dir)) !== false)
{
$file_age = @filemtime($error['file']);
if ($file_age !== false && ($file_age + 60) < time())
{ {
$cache->purge(); $cache->purge();
die('The installer has detected an issue with a cached file. Try reloading the page to resolve the issue. If you require further assistance, please visit the <a href="https://www.phpbb.com/community/">phpBB support forums</a>.'); $symfony_request = new \phpbb\symfony_request(new \phpbb\request\request(new \phpbb\request\type_cast_helper()));
header('Location: ' . $symfony_request->getRequestUri());
exit();
}
else
{
die('The installer has detected an issue with a cached file. Try reloading the page and/or manually clearing the cache to resolve the issue. If you require further assistance, please visit the <a href="https://www.phpbb.com/community/">phpBB support forums</a>.');
}
} }
else if ($error['type'] & $supported_error_levels) else if ($error['type'] & $supported_error_levels)
{ {