Neos\Flow\Cache\CacheFactory::create PHP Method

create() public method

public create ( string $cacheIdentifier, string $cacheObjectName, string $backendObjectName, array $backendOptions = [], boolean $persistent = false ) : Frontend\FrontendInterface
$cacheIdentifier string
$cacheObjectName string
$backendObjectName string
$backendOptions array
$persistent boolean
return Frontend\FrontendInterface
    public function create($cacheIdentifier, $cacheObjectName, $backendObjectName, array $backendOptions = [], $persistent = false)
    {
        $backend = $this->instantiateBackend($backendObjectName, $backendOptions, $persistent);
        $cache = $this->instantiateCache($cacheIdentifier, $cacheObjectName, $backend);
        $backend->setCache($cache);
        return $cache;
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * Instantiates the cache for $identifier.
  *
  * @param string $identifier
  * @return void
  */
 protected function createCache($identifier)
 {
     $frontend = isset($this->cacheConfigurations[$identifier]['frontend']) ? $this->cacheConfigurations[$identifier]['frontend'] : $this->cacheConfigurations['Default']['frontend'];
     $backend = isset($this->cacheConfigurations[$identifier]['backend']) ? $this->cacheConfigurations[$identifier]['backend'] : $this->cacheConfigurations['Default']['backend'];
     $backendOptions = isset($this->cacheConfigurations[$identifier]['backendOptions']) ? $this->cacheConfigurations[$identifier]['backendOptions'] : $this->cacheConfigurations['Default']['backendOptions'];
     $persistent = isset($this->cacheConfigurations[$identifier]['persistent']) ? $this->cacheConfigurations[$identifier]['persistent'] : $this->cacheConfigurations['Default']['persistent'];
     $cache = $this->cacheFactory->create($identifier, $frontend, $backend, $backendOptions, $persistent);
     $this->registerCache($cache, $persistent);
 }
All Usage Examples Of Neos\Flow\Cache\CacheFactory::create