1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 05:50:42 +02:00

[ticket/16432] Display APCu Cache notice when handling extensions through CLI

PHPBB3-16432
This commit is contained in:
mrgoldy
2020-04-12 00:46:00 +02:00
parent c990818200
commit 3e128d06f4
7 changed files with 46 additions and 6 deletions

View File

@@ -25,11 +25,14 @@ class apcu extends \phpbb\cache\driver\memory
*/
function purge()
{
/*
* Use an iterator to selectively delete our cache entries without disturbing
* any other cache users (e.g. other phpBB boards hosted on this server)
*/
apcu_delete(new \APCUIterator('#^' . $this->key_prefix . '#'));
if (PHP_SAPI !== 'cli' || @ini_get('apc.enable_cli'))
{
/*
* Use an iterator to selectively delete our cache entries without disturbing
* any other cache users (e.g. other phpBB boards hosted on this server)
*/
apcu_delete(new \APCUIterator('#^' . $this->key_prefix . '#'));
}
parent::purge();
}