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


PHP Repository::has方法代码示例

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


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

示例1: tryFetchResultFromCache

 /**
  * @param Builder $qb
  * @param array $attributes
  * @return LengthAwarePaginator|Collection|null
  */
 public function tryFetchResultFromCache(Builder $qb, array $attributes = [])
 {
     $this->generateQueryHashFromQueryBuilder($qb, $attributes);
     if ($this->cache->has($this->actualQueryHash)) {
         return $this->cache->get($this->actualQueryHash);
     }
     return null;
 }
开发者ID:Algatux,项目名称:laravel-repository,代码行数:13,代码来源:CacheManager.php

示例2: has

 /**
  * Determine if an item exists in the cache.
  *
  * @param  mixed  $key
  * @return mixed
  */
 public function has($key)
 {
     if (is_array($key)) {
         return $this->hasMany($key);
     }
     return parent::has($key);
 }
开发者ID:pulkitjalan,项目名称:multicache,代码行数:13,代码来源:Repository.php

示例3: postAuthorized

 /**
  * Handles authenticating that a user/character is still valid.
  *
  * @return \Illuminate\Http\JsonResponse
  */
 public function postAuthorized()
 {
     // Get the neccessary headers from the request.
     $service = $this->request->header('service', false);
     $username = $this->request->header('username', '');
     $character = $this->request->header('character', '');
     $this->log->info('A service is attempting to validate a user.', ['username' => $username, 'character' => $character, 'service' => $service]);
     // Verify that the external service exists in the configuration.
     if (!$service || !$this->config->get("addon.auth.{$service}")) {
         $this->log->info(self::ERROR_INVALID_EXTERNAL_SERVICE, ['service' => $service]);
         return $this->failure(self::ERRNO_INVALID_EXTERNAL_SERVICE, self::ERROR_INVALID_EXTERNAL_SERVICE);
     }
     // Check the cache first so the api isn't hammered too badly.
     $key = 'auth:session:' . sha1("{$service}:{$username}");
     if ($this->cache->has($key)) {
         $this->log->info('Returning the cached authorization result.');
         return $this->cache->get($key);
     }
     // Attempt to find the requested user.
     $identifier = filter_var($username, FILTER_VALIDATE_EMAIL) ? 'email' : 'name';
     $user = $this->users->where($identifier, $username)->first() ?: false;
     if (!$user) {
         $this->log->info(self::ERROR_USER_NOT_FOUND);
         return $this->failure(self::ERRNO_USER_NOT_FOUND, self::ERROR_USER_NOT_FOUND);
     }
     // Get and cache the response for 15 minutes.
     $response = $this->getLoginResult($user, $service, $character);
     $this->cache->put($key, $response, $this->carbon->now()->addMinutes(15));
     return $response;
 }
开发者ID:msims04,项目名称:eveseat-addon-auth,代码行数:35,代码来源:AuthController.php

示例4: image

 public function image(Repository $cache, $id)
 {
     if ($cache->has($id)) {
         return $cache->get($id);
     }
     $card = base64_encode(file_get_contents('http://magiccards.info/scans/en/ori/' . $id . '.jpg'));
     $cache->put($id, $card, 60);
     return $card;
 }
开发者ID:NukaCode,项目名称:Magic,代码行数:9,代码来源:HomeController.php

示例5: getCachedView

 /**
  * Check to see whether a view has already been cached for the current
  * route and if so, return it.
  *
  * @return mixed
  */
 protected function getCachedView()
 {
     if (config('sitemap.cache_enabled')) {
         $key = $this->getCacheKey();
         if ($this->cache->has($key)) {
             return $this->cache->get($key);
         }
     }
     return false;
 }
开发者ID:shaggyz,项目名称:sitemap,代码行数:16,代码来源:Sitemap.php

示例6: has

 /**
  * Determine if an item exists in the cache.
  *
  * @param string $key
  * @return bool 
  * @static 
  */
 public static function has($key)
 {
     return \Illuminate\Cache\Repository::has($key);
 }
开发者ID:satriashp,项目名称:tour,代码行数:11,代码来源:_ide_helper.php

示例7: has

 /**
  * @param string $key
  *
  * @return bool
  */
 public function has($key)
 {
     return $this->cache->has($key);
 }
开发者ID:sdebacker,项目名称:laravel-responsecache,代码行数:9,代码来源:ResponseCacheRepository.php

示例8: verifyToken

 /**
  * Verify the given token for a valid user.
  *
  * @param  string $token
  *
  * @return boolean
  */
 public function verifyToken($token)
 {
     return $this->cache->has($this->getCacheKey($token));
 }
开发者ID:vinelab,项目名称:agency,代码行数:11,代码来源:Auth.php

示例9: has

 /**
  * @param $key
  * @return bool
  */
 public function has($key)
 {
     return $this->enabled ? $this->cache->has($key) : false;
 }
开发者ID:coandacms,项目名称:coanda-core,代码行数:8,代码来源:PageStaticCacher.php

示例10: has

 /**
  * Determine if an item exists in the cache.
  *
  * @param  string $key
  * @return bool
  */
 public function has($key)
 {
     if (!$this->operatingOnKeywords()) {
         $this->resetCurrentKeywords();
     }
     return parent::has($key);
 }
开发者ID:propaganistas,项目名称:laravel-cache-keywords,代码行数:13,代码来源:KeywordsRepository.php

示例11: hasCachedPlugins

 /**
  * 캐싱된 플러그인 정보가 있는지 조사한다.
  *
  * @return bool
  */
 public function hasCachedPlugins()
 {
     return $this->cache->has($this->cacheKey);
 }
开发者ID:xpressengine,项目名称:xpressengine,代码行数:9,代码来源:FilePluginCache.php

示例12: isExistCachedSiteInstanceRoutes

 /**
  * isExistCachedSiteInstanceRoutes
  *
  * @param string $siteKey key of to confirm exist site instance routes
  *
  * @return bool
  */
 public function isExistCachedSiteInstanceRoutes($siteKey)
 {
     if ($this->debugMode) {
         return false;
     }
     $keyString = $this->getSiteCacheKeyString($siteKey);
     return $this->cache->has($keyString);
 }
开发者ID:mint-soft-com,项目名称:xpressengine,代码行数:15,代码来源:InstanceRouteCacheHandler.php

示例13: cacheHas

 /**
  * Check a setting exists in cache
  *
  * @param string $key
  *
  * @return boolean
  */
 public function cacheHas($key)
 {
     return $this->cache->has($this->attachTag($key)) ? true : false;
 }
开发者ID:illuminate3,项目名称:Setter,代码行数:11,代码来源:SettingBase.php

示例14: hasItem

 /**
  * Check if cache entry exists
  *
  * @param string $key
  *
  * @return bool
  */
 public function hasItem($key)
 {
     $key = $this->getKey($key);
     return $this->cacheRepository->has($key);
 }
开发者ID:cedricziel,项目名称:l5-shariff,代码行数:12,代码来源:Cache.php


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