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


PHP Cache::derive方法代码示例

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


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

示例1: __construct

 public function __construct(string $wwwDir, Ytnuk\Web\Domain\Repository $repository, VitKutny\Version\Filter $versionFilter, Tracy\ILogger $logger, Nette\Caching\IStorage $storage)
 {
     parent::__construct();
     $this->wwwDir = $wwwDir;
     $this->repository = $repository;
     $this->logger = $logger;
     $this->cache = new Nette\Caching\Cache($storage, strtr(self::class, '\\', Nette\Caching\Cache::NAMESPACE_SEPARATOR));
     $this->filterInCache = $this->cache->derive('filterIn');
     $this->filterOutCache = $this->cache->derive('filterOut');
     $this->versionFilter = $versionFilter;
 }
开发者ID:ytnuk,项目名称:web,代码行数:11,代码来源:Factory.php

示例2: __construct

 /**
  * @param ITemplateLocator
  * @param Cache
  * @param string|null
  * @param bool
  */
 public function __construct(ITemplateLocator $templateLocator, ICachingStorage $storage, $setupFingerprint = NULL, $onlyExistingFiles = FALSE)
 {
     $this->templateLocator = $templateLocator;
     $cache = new Cache($storage, 'Rixxi.TemplateLocator');
     if ($setupFingerprint !== $cache['setupFingerprint']) {
         $cache->clean(array(Cache::ALL => TRUE));
         $cache['setupFingerprint'] = $setupFingerprint;
     }
     $this->filesCache = $cache->derive('files');
     $this->layoutFilesCache = $cache->derive('layoutFiles');
     $this->componentFilesCache = $cache->derive('componentFiles');
     $this->onlyExistingFiles = $onlyExistingFiles;
 }
开发者ID:rixxi,项目名称:template-locator,代码行数:19,代码来源:CachedTemplateLocator.php

示例3: __construct

 public function __construct(Connection $connection, $storageName, array $entityPrimaryKey, Cache $cache)
 {
     $this->platform = new CachedPlatform($connection, $cache->derive('db_reflection'));
     $this->storageName = $storageName;
     $this->entityPrimaryKey = $entityPrimaryKey;
     $cache = $cache->derive('storage_reflection');
     $this->mappings = $cache->load('nextras.orm.storage_reflection.' . md5($this->storageName) . '.mappings', function () {
         return $this->getDefaultMappings();
     });
     $this->modifiers = $cache->load('nextras.orm.storage_reflection.' . md5($this->storageName) . '.modifiers', function () {
         return $this->getDefaultModifiers();
     });
 }
开发者ID:nextras,项目名称:orm,代码行数:13,代码来源:StorageReflection.php

示例4: __construct

 public function __construct(array $entityClassesMap, Cache $cache, IMetadataParserFactory $metadataParserFactory, IRepositoryLoader $repositoryLoader)
 {
     static::$metadata = $cache->derive('metadata')->load($entityClassesMap, function (&$dp) use($entityClassesMap, $metadataParserFactory, $repositoryLoader) {
         $metadata = [];
         $annotationParser = $metadataParserFactory->create($entityClassesMap);
         foreach (array_keys($entityClassesMap) as $className) {
             $metadata[$className] = $annotationParser->parseMetadata($className, $dp[Cache::FILES]);
         }
         $validator = new MetadataValidator();
         $validator->validate($metadata, $repositoryLoader);
         return $metadata;
     });
 }
开发者ID:nextras,项目名称:orm,代码行数:13,代码来源:MetadataStorage.php

示例5: __construct

 public function __construct(Connection $connection, Cache $cache)
 {
     $key = md5(json_encode($connection->getConfig()));
     $this->connection = $connection;
     $this->cache = $cache->derive('mapper.' . $key);
 }
开发者ID:nextras,项目名称:orm,代码行数:6,代码来源:DbalMapper.php


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