diff options
author | Daniel Kesselberg <mail@danielkesselberg.de> | 2019-01-30 16:28:47 +0100 |
---|---|---|
committer | Daniel Kesselberg <mail@danielkesselberg.de> | 2019-01-30 16:28:47 +0100 |
commit | 1638f89e8920798a731be6efec61e69dec5f74ac (patch) | |
tree | 6781663cf9304ef8737873025b4d7213a72f87b5 /lib | |
parent | deb7d2364f38ce24bee62cd490fccfd6e4d3f059 (diff) | |
download | nextcloud-server-1638f89e8920798a731be6efec61e69dec5f74ac.tar.gz nextcloud-server-1638f89e8920798a731be6efec61e69dec5f74ac.zip |
Don't call apc_delete_file and apc_clear_cache anymore
There is no apc for PHP7+ so there is no need to check if exist.
accelerator_reset looks even more ancient.
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/legacy/util.php | 31 |
1 files changed, 6 insertions, 25 deletions
diff --git a/lib/private/legacy/util.php b/lib/private/legacy/util.php index a94ced8bb1f..cd6ce0b64ae 100644 --- a/lib/private/legacy/util.php +++ b/lib/private/legacy/util.php @@ -1334,19 +1334,11 @@ class OC_Util { * @param string $path the path of the file to clear from the cache * @return bool true if underlying function returns true, otherwise false */ - public static function deleteFromOpcodeCache($path) { - $ret = false; - if ($path) { - // APC >= 3.1.1 - if (function_exists('apc_delete_file')) { - $ret = @apc_delete_file($path); - } - // Zend OpCache >= 7.0.0, PHP >= 5.5.0 - if (function_exists('opcache_invalidate')) { - $ret = @opcache_invalidate($path); - } + public static function deleteFromOpcodeCache($path): bool { + if (!empty($path) && function_exists('opcache_invalidate')) { + return @opcache_invalidate($path); // Zend OpCache >= 7.0.0, PHP >= 5.5.0 } - return $ret; + return false; } /** @@ -1355,21 +1347,10 @@ class OC_Util { * in case the opcode cache does not re-validate files * * @return void - * @suppress PhanDeprecatedFunction - * @suppress PhanUndeclaredConstant */ - public static function clearOpcodeCache() { - // APC - if (function_exists('apc_clear_cache')) { - apc_clear_cache(); - } - // Zend Opcache - if (function_exists('accelerator_reset')) { - accelerator_reset(); - } - // Opcache (PHP >= 5.5) + public static function clearOpcodeCache(): void { if (function_exists('opcache_reset')) { - @opcache_reset(); + @opcache_reset(); // Opcache (PHP >= 5.5) } } |