當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Repository::rememberForever方法代碼示例

本文整理匯總了PHP中Illuminate\Cache\Repository::rememberForever方法的典型用法代碼示例。如果您正苦於以下問題:PHP Repository::rememberForever方法的具體用法?PHP Repository::rememberForever怎麽用?PHP Repository::rememberForever使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Cache\Repository的用法示例。


在下文中一共展示了Repository::rememberForever方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 /**
  * Settings constructor.
  *
  * @param CacheRepository $cache
  * @param Manager         $manager
  */
 public function __construct(CacheRepository $cache, Manager $manager)
 {
     $this->cache = $cache;
     parent::__construct($this->cache->rememberForever(self::CACHE_KEY, function () use($manager) {
         return Entities\Settings::all()->pluck('value', 'name')->all();
     }));
 }
開發者ID:rabbitcms,項目名稱:settings,代碼行數:13,代碼來源:Repository.php

示例2: format

 /**
  * {@inheritdoc}
  */
 protected function format($string)
 {
     if (!$this->watch) {
         $key = 'js.' . sha1($string);
         $string = $this->cache->rememberForever($key, function () use($string) {
             return $this->minify($string);
         });
     }
     return $string . ";\n";
 }
開發者ID:clops,項目名稱:core,代碼行數:13,代碼來源:JsCompiler.php

示例3: rememberForever

 /**
  * Get an item from the cache, or store the default value forever.
  *
  * @param  string   $key
  * @param  \Closure $callback
  *
  * @return mixed
  */
 public function rememberForever($key, Closure $callback)
 {
     if ($this->enabled) {
         return $this->cache->rememberForever($key, $callback);
     }
     return $callback;
 }
開發者ID:wegnermedia,項目名稱:melon,代碼行數:15,代碼來源:Cacher.php

示例4: getSubTitle

 /**
  * Get the page sub title
  *
  * @param string $page
  * @return string
  */
 public function getSubTitle($page)
 {
     $pageFile = $this->getDocumentationPath() . "/{$page}.md";
     return $this->cache->rememberForever("doc_page_{$pageFile}_sub-title", function () use($pageFile) {
         $data = $this->parser->parse($this->finder->get($pageFile));
         return $data->get('subtitle');
     });
 }
開發者ID:Houbsi,項目名稱:Website,代碼行數:14,代碼來源:GitDocumentationRepository.php

示例5: rememberForever

 /**
  * Get an item from the cache, or store the default value forever.
  *
  * @param string $key
  * @param \Closure $callback
  * @return mixed 
  * @static 
  */
 public static function rememberForever($key, $callback)
 {
     return \Illuminate\Cache\Repository::rememberForever($key, $callback);
 }
開發者ID:satriashp,項目名稱:tour,代碼行數:12,代碼來源:_ide_helper.php

示例6: rememberForever

 /**
  * Get an item from the cache, or store the default value forever.
  *
  * @param  string   $key
  * @param  \Closure  $callback
  * @return mixed
  */
 public function rememberForever($key, Closure $callback)
 {
     if (is_array($key)) {
         return $this->rememberManyForever($key, $callback);
     }
     return parent::rememberForever($key, $callback);
 }
開發者ID:pulkitjalan,項目名稱:multicache,代碼行數:14,代碼來源:Repository.php


注:本文中的Illuminate\Cache\Repository::rememberForever方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。