You are here

protected static function OpcodeCache::hasOpcodeFileCache in Automatic Updates 7

Determine if opcode cache is enabled.

If opcache.validate_timestamps is disabled or enabled with opcache.revalidate_freq greater then 2, then a site is considered to have opcode caching. The default php.ini setup is opcache.validate_timestamps=TRUE and opcache.revalidate_freq=2.

Return value

bool TRUE if opcode file cache is enabled, FALSE otherwise.

1 call to OpcodeCache::hasOpcodeFileCache()
OpcodeCache::run in ReadinessCheckers/OpcodeCache.php
Run check.

File

ReadinessCheckers/OpcodeCache.php, line 40

Class

OpcodeCache
Error if opcode caching is enabled and updates are executed via CLI.

Code

protected static function hasOpcodeFileCache() {
  if (!ini_get('opcache.validate_timestamps')) {
    return TRUE;
  }
  if (ini_get('opcache.revalidate_freq') > 2) {
    return TRUE;
  }
  return FALSE;
}