src/Core/Cache/CacheManager.php
public function getCache(
        string $name = 'windwalker',
        string $storage = 'array',
        string $serializer = 'php',
        array $options = []
    ): CacheInterface {
        $config = $this->config;

        $debug   = $config->get('system.debug', false);
        $enabled = $config->get('cache.enabled', false);

        $forceEnabled = $options['force_enabled'] ?? false;

        if (!$forceEnabled && ($debug || !$enabled) && !$this->ignoreGlobal) {
            $storage    = 'null';
            $serializer = 'raw';
        }

        return $this->create($name, $storage, $serializer, $options);
    }
public function getCache(
        string $name = 'windwalker',
        string $storage = 'array',
        string $serializer = 'php',
        array $options = []
    ): CacheInterface {
        $config = $this->config;

        $debug   = $config->get('system.debug', false);
        $enabled = $config->get('cache.enabled', false);

        $forceEnabled = $options['force_enabled'] ?? false;

        if (!$forceEnabled && ($debug || !$enabled) && !$this->ignoreGlobal) {
            $storage    = 'null';
            $serializer = 'raw';
        }

        return $this->create($name, $storage, $serializer, $options);
    }
public function getCache ( string $ name = 'windwalker' , string $ storage = 'array' , string $ serializer = 'php' , array $ options = [ ] ) : CacheInterface { $ config = $ this -> config ; $ debug = $ config -> get ( 'system.debug' , false ) ; $ enabled = $ config -> get ( 'cache.enabled' , false ) ; $ forceEnabled = $ options [ 'force_enabled' ] ?? false ; if ( ! $ forceEnabled && ( $ debug || ! $ enabled ) && ! $ this -> ignoreGlobal ) { $ storage = 'null' ; $ serializer = 'raw' ; } return $ this -> create ( $ name , $ storage , $ serializer , $ options ) ; }
Create cache object.

@param string $name
@param string $storage
@param string $serializer
@param array  $options

@return  CacheInterface
@throws \ReflectionException
@throws \Windwalker\DI\Exception\DependencyResolutionException

@deprecated Use getCacheInstance() instead.
Create cache object .