1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-04-08 18:05:17 +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
No known key found for this signature in database
GPG Key ID: 50E0D2423696F995

View File

@ -133,9 +133,21 @@ function installer_shutdown_function($display_errors)
$cache = new \phpbb\cache\driver\file(__DIR__ . '/../cache/installer');
if (strpos($error['file'], realpath($cache->cache_dir)) !== false)
{
$cache->purge();
$file_age = @filemtime($error['file']);
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>.');
if ($file_age !== false && ($file_age + 60) < time())
{
$cache->purge();
$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)
{