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


PHP Repository::getStore方法代碼示例

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


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

示例1: setCacheRepository

 /**
  * @param Repository $repository
  * @throws \Exception
  */
 private function setCacheRepository(Repository $repository)
 {
     if (!$repository->getStore() instanceof TaggableStore) {
         throw new \Exception('Cache driver must be extended from Illuminate\\Cache\\TaggableStore ');
     }
     $this->cache = $repository;
 }
開發者ID:emtudo,項目名稱:InfinityCache,代碼行數:11,代碼來源:Model.php

示例2: isSatisfiedBy

 /**
  * @param Repository $repository
  *
  * @throws CacheTagsNotSupported
  * @return bool
  */
 public function isSatisfiedBy(Repository $repository)
 {
     if (!method_exists($repository->getStore(), 'tags')) {
         throw new CacheTagsNotSupported('Cache tags are necessary to use this kind of caching. Consider using a different caching method');
     }
     return true;
 }
開發者ID:fordongu,項目名稱:maigc-menubar,代碼行數:13,代碼來源:SupportsCacheTags.php

示例3: determineTagSupport

 /**
  * Detect as best we can whether tags are supported with this repository & store,
  * and save our result on the $supportsTags flag.
  *
  * @return void
  */
 protected function determineTagSupport()
 {
     // Laravel >= 5.1.28
     if (method_exists($this->cache, 'tags')) {
         try {
             // Attempt the repository tags command, which throws exceptions when unsupported
             $this->cache->tags($this->tag);
             $this->supportsTags = true;
         } catch (BadMethodCallException $ex) {
             $this->supportsTags = false;
         }
     } else {
         // Laravel <= 5.1.27
         if (method_exists($this->cache, 'getStore')) {
             // Check for the tags function directly on the store
             $this->supportsTags = method_exists($this->cache->getStore(), 'tags');
         } else {
             // Must be using custom cache repository without getStore(), and all bets are off,
             // or we are mocking the cache contract (in testing), which will not create a getStore method
             $this->supportsTags = false;
         }
     }
 }
開發者ID:a161527,項目名稱:cs319-p2t5,代碼行數:29,代碼來源:Illuminate.php

示例4: make

 /**
  * Make a new cache throttler instance.
  *
  * @param \GrahamCampbell\Throttle\Data $data
  *
  * @return \GrahamCampbell\Throttle\Throttlers\CacheThrottler
  */
 public function make(Data $data)
 {
     return new CacheThrottler($this->cache->getStore(), $data->getKey(), $data->getLimit(), $data->getTime());
 }
開發者ID:Preferizi,項目名稱:Laravel-Throttle,代碼行數:11,代碼來源:CacheFactory.php


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