当前位置: 首页>>代码示例>>PHP>>正文


PHP VariableFrontend::getBackend方法代码示例

本文整理汇总了PHP中TYPO3\Flow\Cache\Frontend\VariableFrontend::getBackend方法的典型用法代码示例。如果您正苦于以下问题:PHP VariableFrontend::getBackend方法的具体用法?PHP VariableFrontend::getBackend怎么用?PHP VariableFrontend::getBackend使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TYPO3\Flow\Cache\Frontend\VariableFrontend的用法示例。


在下文中一共展示了VariableFrontend::getBackend方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: initializeObject

 /**
  * @return void
  * @throws \TYPO3\Flow\Cache\Exception\InvalidBackendException
  */
 public function initializeObject()
 {
     if (!$this->metaDataCache->getBackend() instanceof IterableBackendInterface) {
         throw new InvalidBackendException(sprintf('The session meta data cache must provide a backend implementing the IterableBackendInterface, but the given backend "%s" does not implement it.', get_class($this->metaDataCache->getBackend())), 1370964557);
     }
     if (!$this->storageCache->getBackend() instanceof IterableBackendInterface) {
         throw new InvalidBackendException(sprintf('The session storage cache must provide a backend implementing the IterableBackendInterface, but the given backend "%s" does not implement it.', get_class($this->storageCache->getBackend())), 1370964558);
     }
 }
开发者ID:cerlestes,项目名称:flow-development-collection,代码行数:13,代码来源:Session.php

示例2: saveToCache

 /**
  * Exports the internal reflection data into the ReflectionData cache
  *
  * This method is triggered by a signal which is connected to the bootstrap's
  * shutdown sequence.
  *
  * If the reflection data has previously been loaded from the runtime cache,
  * saving it is omitted as changes are not expected.
  *
  * In Production context the whole cache is written at once and then frozen in
  * order to be consistent. Frozen cache data in Development is only produced for
  * classes contained in frozen packages.
  *
  * @return void
  * @throws \TYPO3\Flow\Reflection\Exception if no cache has been injected
  */
 public function saveToCache()
 {
     if (!$this->initialized) {
         $this->initialize();
     }
     if ($this->loadFromClassSchemaRuntimeCache === TRUE) {
         return;
     }
     if (!$this->reflectionDataCompiletimeCache instanceof FrontendInterface) {
         throw new Exception('A cache must be injected before initializing the Reflection Service.', 1232044697);
     }
     if (count($this->updatedReflectionData) > 0) {
         $this->log(sprintf('Found %s classes whose reflection data was not cached previously.', count($this->updatedReflectionData)), LOG_DEBUG);
         foreach (array_keys($this->updatedReflectionData) as $className) {
             $this->statusCache->set(str_replace('\\', '_', $className), '');
         }
         $data = array();
         $propertyNames = array('classReflectionData', 'classSchemata', 'annotatedClasses', 'classesByMethodAnnotations');
         foreach ($propertyNames as $propertyName) {
             $data[$propertyName] = $this->{$propertyName};
         }
         $this->reflectionDataCompiletimeCache->set('ReflectionData', $data);
     }
     if ($this->context->isProduction()) {
         $this->reflectionDataRuntimeCache->flush();
         $classNames = array();
         foreach ($this->classReflectionData as $className => $reflectionData) {
             $classNames[$className] = TRUE;
             $this->reflectionDataRuntimeCache->set(str_replace('\\', '_', $className), $reflectionData);
             if (isset($this->classSchemata[$className])) {
                 $this->classSchemataRuntimeCache->set(str_replace('\\', '_', $className), $this->classSchemata[$className]);
             }
         }
         $this->reflectionDataRuntimeCache->set('__classNames', $classNames);
         $this->reflectionDataRuntimeCache->set('__annotatedClasses', $this->annotatedClasses);
         $this->reflectionDataRuntimeCache->getBackend()->freeze();
         $this->classSchemataRuntimeCache->getBackend()->freeze();
         $this->log(sprintf('Built and froze reflection runtime caches (%s classes).', count($this->classReflectionData)), LOG_INFO);
     } elseif ($this->context->isDevelopment()) {
         foreach (array_keys($this->packageManager->getFrozenPackages()) as $packageKey) {
             $pathAndFilename = $this->getPrecompiledReflectionStoragePath() . $packageKey . '.dat';
             if (!file_exists($pathAndFilename)) {
                 $this->log(sprintf('Rebuilding precompiled reflection data for frozen package %s.', $packageKey), LOG_INFO);
                 $this->freezePackageReflection($packageKey);
             }
         }
     }
 }
开发者ID:animaltool,项目名称:webinterface,代码行数:64,代码来源:ReflectionService.php

示例3: saveProductionData

 /**
  * Save reflection data to cache in Production context.
  */
 protected function saveProductionData()
 {
     $this->reflectionDataRuntimeCache->flush();
     $classNames = [];
     foreach ($this->classReflectionData as $className => $reflectionData) {
         $classNames[$className] = true;
         $cacheIdentifier = $this->produceCacheIdentifierFromClassName($className);
         $this->reflectionDataRuntimeCache->set($cacheIdentifier, $reflectionData);
         if (isset($this->classSchemata[$className])) {
             $this->classSchemataRuntimeCache->set($cacheIdentifier, $this->classSchemata[$className]);
         }
     }
     $this->reflectionDataRuntimeCache->set('__classNames', $classNames);
     $this->reflectionDataRuntimeCache->set('__annotatedClasses', $this->annotatedClasses);
     $this->reflectionDataRuntimeCache->getBackend()->freeze();
     $this->classSchemataRuntimeCache->getBackend()->freeze();
     $this->log(sprintf('Built and froze reflection runtime caches (%s classes).', count($this->classReflectionData)), LOG_INFO);
 }
开发者ID:kszyma,项目名称:flow-development-collection,代码行数:21,代码来源:ReflectionService.php

示例4: hasFrozenCacheInProduction

 /**
  * @return boolean
  */
 protected function hasFrozenCacheInProduction()
 {
     return $this->environment->getContext()->isProduction() && $this->reflectionDataRuntimeCache->getBackend()->isFrozen();
 }
开发者ID:mkeitsch,项目名称:flow-development-collection,代码行数:7,代码来源:ReflectionService.php


注:本文中的TYPO3\Flow\Cache\Frontend\VariableFrontend::getBackend方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。