當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。