public static function createCache($namespace, $defaultLifetime, $version, LoggerInterface $logger = null)
    {
        if (!class_exists('Symfony\Component\Cache\Adapter\ApcuAdapter')) {
            throw new \LogicException(sprintf('The Symfony Cache component must be installed to use %s().', __METHOD__));
        }

        if (!ApcuAdapter::isSupported()) {
            return new NullAdapter();
        }

        $apcu = new ApcuAdapter($namespace, $defaultLifetime / 5, $version);
        if ('cli' === \PHP_SAPI && !filter_var(ini_get('apc.enable_cli'), FILTER_VALIDATE_BOOLEAN)) {
            $apcu->setLogger(new NullLogger());
        } elseif (null !== $logger) {
            $apcu->setLogger($logger);
        }

        return $apcu;
    }
public static function createCache($namespace, $defaultLifetime, $version, LoggerInterface $logger = null)
    {
        if (!class_exists('Symfony\Component\Cache\Adapter\ApcuAdapter')) {
            throw new \LogicException(sprintf('The Symfony Cache component must be installed to use %s().', __METHOD__));
        }

        if (!ApcuAdapter::isSupported()) {
            return new NullAdapter();
        }

        $apcu = new ApcuAdapter($namespace, $defaultLifetime / 5, $version);
        if ('cli' === \PHP_SAPI && !filter_var(ini_get('apc.enable_cli'), FILTER_VALIDATE_BOOLEAN)) {
            $apcu->setLogger(new NullLogger());
        } elseif (null !== $logger) {
            $apcu->setLogger($logger);
        }

        return $apcu;
    }
public static function createCache ( $ namespace , $ defaultLifetime , $ version , LoggerInterface $ logger = null ) { if ( ! class_exists ( 'Symfony\Component\Cache\Adapter\ApcuAdapter' ) ) { throw new \ LogicException ( sprintf ( 'The Symfony Cache component must be installed to use %s().' , __METHOD__ ) ) ; } if ( ! ApcuAdapter :: isSupported ( ) ) { return new NullAdapter ( ) ; } $ apcu = new ApcuAdapter ( $ namespace , $ defaultLifetime / 5 , $ version ) ; if ( 'cli' === \ PHP_SAPI && ! filter_var ( ini_get ( 'apc.enable_cli' ) , FILTER_VALIDATE_BOOLEAN ) ) { $ apcu -> setLogger ( new NullLogger ( ) ) ; } elseif ( null !== $ logger ) { $ apcu -> setLogger ( $ logger ) ; } return $ apcu ; }
Creates the APCu adapter if applicable.

@param string               $namespace
@param int                  $defaultLifetime
@param string               $version
@param LoggerInterface|null $logger

@return AdapterInterface

@throws RuntimeException When the Cache Component isn't available
Creates the APCu adapter if applicable .