You are here

protected function OpcodeCache::hasOpcodeFileCache in Automatic Updates 8

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 src/ReadinessChecker/OpcodeCache.php
Run check.

File

src/ReadinessChecker/OpcodeCache.php, line 45

Class

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

Namespace

Drupal\automatic_updates\ReadinessChecker

Code

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