1 bootstrap.inc | backdrop_clear_opcode_cache($filepath) |
Invalidates a PHP file from any active opcode caches.
If the opcode cache does not support the invalidation of individual files, the entire cache will be flushed.
Parameters
string $filepath: The absolute path of the PHP file to invalidate.
File
- core/
includes/ bootstrap.inc, line 4483 - Functions that need to be loaded on every Backdrop request.
Code
function backdrop_clear_opcode_cache($filepath) {
clearstatcache(TRUE, $filepath);
// Zend OPcache.
if (function_exists('opcache_invalidate')) {
// Suppress any warnings in PHP 7.2+ caused by "Zend OPcache API is
// restricted by "restrict_api" configuration directive".
@opcache_invalidate($filepath, TRUE);
}
// APC.
if (function_exists('apc_delete_file')) {
// apc_delete_file() throws a PHP warning in case the specified file was
// not compiled yet.
// @see http://php.net/apc-delete-file
@apc_delete_file($filepath);
}
}