OpcodeCache.php in Automatic Updates 7
File
ReadinessCheckers/OpcodeCache.php
View source
<?php
class OpcodeCache implements ReadinessCheckerInterface {
public static function run() {
$messages = [];
if (self::isCli() && self::hasOpcodeFileCache()) {
$messages[] = t('Automatic updates cannot run via CLI when opcode file cache is enabled.');
}
return $messages;
}
protected static function isCli() {
return PHP_SAPI === 'cli';
}
protected static function hasOpcodeFileCache() {
if (!ini_get('opcache.validate_timestamps')) {
return TRUE;
}
if (ini_get('opcache.revalidate_freq') > 2) {
return TRUE;
}
return FALSE;
}
}
Classes
Name |
Description |
OpcodeCache |
Error if opcode caching is enabled and updates are executed via CLI. |