Back to ApcuStorage class

Method isSupported

public static bool
isSupported
()
Test to see if the storage handler is available.
Returns
  • bool
Since
  • 3.5
Class: ApcuStorage
Project: Joomla

Method isSupported - Source code

/**
 * Test to see if the storage handler is available.
 *
 * @return  boolean
 *
 * @since   3.5
 */
public static function isSupported()
{
    $supported = \extension_loaded('apcu') && ini_get('apc.enabled');
    // If on the CLI interface, the `apc.enable_cli` option must also be enabled
    if ($supported && PHP_SAPI === 'cli') {
        $supported = ini_get('apc.enable_cli');
    }
    return (bool) $supported;
}