Same filename and directory in other branches
- 8.9.x core/lib/Drupal/Component/Utility/OpCodeCache.php
- 9 core/lib/Drupal/Component/Utility/OpCodeCache.php
Namespace
Drupal\Component\Utility
File
core/lib/Drupal/Component/Utility/OpCodeCache.php
View source
<?php
namespace Drupal\Component\Utility;
class OpCodeCache {
public static function isEnabled() {
return extension_loaded('Zend OPcache') && ini_get('opcache.enable');
}
public static function invalidate($pathname) {
clearstatcache(TRUE, $pathname);
if (function_exists('opcache_invalidate')) {
opcache_invalidate($pathname, TRUE);
}
}
}
Classes