Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Runtime.php

function Runtime::isOpcacheActive

2 calls to Runtime::isOpcacheActive()
Runtime::discardsComments in vendor/sebastian/environment/src/Runtime.php
Returns true when Zend OPcache is loaded, enabled, and is configured to discard comments.
Runtime::performsJustInTimeCompilation in vendor/sebastian/environment/src/Runtime.php
Returns true when Zend OPcache is loaded, enabled, and is configured to perform just-in-time compilation.

File

vendor/sebastian/environment/src/Runtime.php, line 278

Class

Runtime

Namespace

SebastianBergmann\Environment

Code

private function isOpcacheActive() : bool {
    if (!extension_loaded('Zend OPcache')) {
        return false;
    }
    if ((PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') && ini_get('opcache.enable_cli') === '1') {
        return true;
    }
    if (PHP_SAPI !== 'cli' && PHP_SAPI !== 'phpdbg' && ini_get('opcache.enable') === '1') {
        return true;
    }
    return false;
}
RSS feed
Powered by Drupal