|
|
|
@ -1323,37 +1323,6 @@ class OC_Util {
|
|
|
|
|
return $theme;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Clear a single file from the opcode cache
|
|
|
|
|
* This is useful for writing to the config file
|
|
|
|
|
* in case the opcode cache does not re-validate files
|
|
|
|
|
* Returns true if successful, false if unsuccessful:
|
|
|
|
|
* caller should fall back on clearing the entire cache
|
|
|
|
|
* with clearOpcodeCache() if unsuccessful
|
|
|
|
|
*
|
|
|
|
|
* @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): bool {
|
|
|
|
|
if (!empty($path) && function_exists('opcache_invalidate')) {
|
|
|
|
|
return @opcache_invalidate($path); // Zend OpCache >= 7.0.0, PHP >= 5.5.0
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Clear the opcode cache if one exists
|
|
|
|
|
* This is necessary for writing to the config file
|
|
|
|
|
* in case the opcode cache does not re-validate files
|
|
|
|
|
*
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
public static function clearOpcodeCache(): void {
|
|
|
|
|
if (function_exists('opcache_reset')) {
|
|
|
|
|
@opcache_reset(); // Opcache (PHP >= 5.5)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Normalize a unicode string
|
|
|
|
|
*
|
|
|
|
|