當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。