当前位置: 首页>>代码示例>>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;未经允许,请勿转载。