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


PHP Repository::forever方法代码示例

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


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

示例1: setPluginsToCache

 /**
  * XE3에 존재하는 플러그인의 PluginEntity 목록을 캐시에 저장한다.
  *
  * @param array $plugins 캐시에 저장할 plugin info 목록
  *
  * @return void
  */
 public function setPluginsToCache(array $plugins)
 {
     $this->plugins = $plugins;
     $dataJson = json_enc($plugins);
     // save plugins info to cache
     $this->cache->forever($this->cacheKey, $dataJson);
 }
开发者ID:xpressengine,项目名称:xpressengine,代码行数:14,代码来源:FilePluginCache.php

示例2: save

 /**
  * {@inheritdoc}
  */
 public function save($key, CacheEntry $data)
 {
     try {
         $lifeTime = $data->getTTL();
         if ($lifeTime === 0) {
             return $this->cache->forever($key, serialize($data));
         } else {
             if ($lifeTime > 0) {
                 return $this->cache->add($key, serialize($data), $lifeTime);
             }
         }
     } catch (\Exception $ignored) {
         // No fail if we can't save it the storage
     }
     return false;
 }
开发者ID:kevinrob,项目名称:guzzle-cache-middleware,代码行数:19,代码来源:LaravelCacheStorage.php

示例3: makeCacheKey

 /**
  * make a cache key
  *
  * @param string $key
  * @param string $prefix
  * @return string
  */
 private function makeCacheKey($key, $prefix = '')
 {
     $key = md5($prefix . $key);
     $keys = $this->cache->get(self::CACHE_KEYS_KEY, []);
     $keys[$key] = $key;
     $this->cache->forever(self::CACHE_KEYS_KEY, $keys);
     return $key;
 }
开发者ID:rokde,项目名称:laravel-query-analyzer,代码行数:15,代码来源:QueryRepository.php

示例4: findAndInstallThemes

 /**
  * Create a cache of the themes which are available on the filesystem.
  *
  * @return array
  */
 public function findAndInstallThemes()
 {
     $theme = new Theme();
     $directories = $this->filesystem->directories($theme->getThemesDirectory());
     $themes = [];
     if (is_array($directories)) {
         foreach ($directories as $directory) {
             $themeName = basename($directory);
             $themes[] = new Theme($themeName);
         }
     }
     $this->cache->forever($this->cacheKey, $themes);
     return $themes;
 }
开发者ID:boomcms,项目名称:boom-core,代码行数:19,代码来源:Manager.php

示例5: search

 public function search(Repository $cache, $search = 'enchantment')
 {
     $client = new Client(config('algolia.connections.main.id'), config('algolia.connections.main.key'));
     //if ($cache->has('origins.'. $search)) {
     //    $cards = $cache->get($search);
     //} else {
     $index = $client->initIndex(config('algolia.index'));
     $index->setSettings(['attributesForFaceting' => ['colors', 'multiverseid']]);
     $cards = $index->search($search, ['facets' => '*', 'facetFilters' => 'colors:Green'])['hits'];
     foreach ($cards as $index => $card) {
         if (isset($card['manaCost'])) {
             $cards[$index]['manaCost'] = preg_replace('/{(.)}/', '<img src="/images/blank.png" id="$1" />', $card['manaCost']);
         }
     }
     $cache->forever($search, $cards);
     //}
     $this->setJavascriptData(compact('cards'));
 }
开发者ID:NukaCode,项目名称:Magic,代码行数:18,代码来源:HomeController.php

示例6: forever

 /**
  * Store an item in the cache indefinitely.
  *
  * @param string $key
  * @param mixed $value
  * @return void 
  * @static 
  */
 public static function forever($key, $value)
 {
     \Illuminate\Cache\Repository::forever($key, $value);
 }
开发者ID:satriashp,项目名称:tour,代码行数:12,代码来源:_ide_helper.php

示例7: forever

 /**
  * Store an item in the cache indefinitely.
  *
  * @param  mixed  $key
  * @param  mixed  $value
  * @return void
  */
 public function forever($key, $value)
 {
     if (is_array($key) && is_array($value)) {
         $this->foreverMany(array_combine($key, $value));
     } else {
         parent::forever($key, $value);
     }
 }
开发者ID:pulkitjalan,项目名称:multicache,代码行数:15,代码来源:Repository.php

示例8: updateInverseIndex

 /**
  * Updates the inverse index for the given cache key.
  *
  * @param  string             $key
  * @param  \DateTime|int|null $minutes
  */
 protected function updateInverseIndex($key, $minutes = null)
 {
     $this->setKeywordsOperation(true);
     $keywordsState = $this->determineKeywordsState($key);
     $inverseIndexKey = $this->generateInverseIndexKey($key);
     if (empty($keywordsState['new'])) {
         parent::forget($inverseIndexKey);
     } elseif ($keywordsState['old'] != $keywordsState['new']) {
         $newInverseIndex = array_values($keywordsState['new']);
         is_null($minutes) ? parent::forever($inverseIndexKey, $newInverseIndex) : parent::put($inverseIndexKey, $newInverseIndex, $minutes);
     }
     $this->setKeywordsOperation(false);
 }
开发者ID:propaganistas,项目名称:laravel-cache-keywords,代码行数:19,代码来源:KeywordsRepository.php

示例9: updateConfigVersion

 public function updateConfigVersion($version)
 {
     $this->cache->forever('laravel-asset-versioning.version', $version);
 }
开发者ID:escapework,项目名称:laravel-asset-versioning,代码行数:4,代码来源:AssetDistCommand.php

示例10: saveToCache

 /**
  * Save a chunk to the cache.
  *
  * @param type            $type
  * @param type            $slotname
  * @param type            $version
  * @param null|ChunkModel $chunk
  */
 public function saveToCache($type, $slotname, $version, ChunkModel $chunk = null)
 {
     $key = $this->getCacheKey($type, $slotname, $version);
     $this->cache->forever($key, $chunk);
 }
开发者ID:boomcms,项目名称:boom-core,代码行数:13,代码来源:Provider.php

示例11: forever

 /**
  * Store an item in the cache indefinitely.
  *
  * @param  string $key
  * @param  mixed  $value
  *
  * @return void
  */
 public function forever($key, $value)
 {
     if ($this->enabled) {
         $this->cache->forever($key, $value);
     }
 }
开发者ID:wegnermedia,项目名称:melon,代码行数:14,代码来源:Cacher.php

示例12: setSiteInstanceCache

 /**
  * setSiteInstanceCache
  *
  * @param string          $siteKey        to regenerate site instances cache
  * @param InstanceRoute[] $instanceRoutes instance routes array
  *
  * @return void
  */
 public function setSiteInstanceCache($siteKey, $instanceRoutes)
 {
     $keyString = $this->getSiteCacheKeyString($siteKey);
     $this->cache->forever($keyString, serialize($instanceRoutes));
 }
开发者ID:mint-soft-com,项目名称:xpressengine,代码行数:13,代码来源:InstanceRouteCacheHandler.php


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