2 namespace TYPO3\CMS\Core\Cache;
55 $this->cacheManager->injectCacheFactory($this);
71 public function create($cacheIdentifier, $cacheObjectName, $backendObjectName, array $backendOptions = array())
75 $backendObjectName =
'\\' . ltrim($backendObjectName,
'\\');
76 $backend =
new $backendObjectName($this->context, $backendOptions);
77 if (!$backend instanceof \TYPO3\CMS\Core\Cache\Backend\BackendInterface) {
78 throw new \TYPO3\CMS\Core\Cache\Exception\InvalidBackendException(
'"' . $backendObjectName .
'" is not a valid cache backend object.', 1216304301);
80 if (is_callable(array($backend,
'initializeObject'))) {
81 $backend->initializeObject();
84 $cache =
new $cacheObjectName($cacheIdentifier, $backend);
85 if (!$cache instanceof \TYPO3\CMS\Core\Cache\Frontend\FrontendInterface) {
86 throw new \TYPO3\CMS\Core\Cache\Exception\InvalidCacheException(
'"' . $cacheObjectName .
'" is not a valid cache frontend object.', 1216304300);
88 if (is_callable(array($cache,
'initializeObject'))) {
89 $cache->initializeObject();
91 $this->cacheManager->registerCache($cache);