コード例 #1
0
ファイル: Auth.php プロジェクト: vinelab/agency
 /**
  * Verify the existence of the given user token.
  *
  * @param string $token
  *
  * @return \Fahita\Contracts\UserInterface|null
  */
 public function loginWithToken($token)
 {
     if ($this->verifyToken($token)) {
         $id = $this->cache->get($this->getCacheKey($token));
         $attributes = $this->redis->hgetall('users:' . $id);
         $user = (new User())->newInstance($attributes, true);
         // creating a new instance does not include the record id
         // but we want it, so we force fill it to fulfill it.
         $user->forceFill($attributes);
         return $this->login($user);
     }
 }
コード例 #2
0
 /**
  * Create an instance of the Redis cache driver.
  *
  * @param  array $config
  *
  * @return \Illuminate\Cache\RedisStore|\Illuminate\Cache\FileStore
  */
 protected function createRedisDriver(array $config)
 {
     $redis = $this->app['redis'];
     $connection = \Illuminate\Support\Arr::get($config, 'connection', 'default') ?: 'default';
     $store = new RedisStore($redis, $this->getPrefix($config), $connection);
     try {
         $store->getRedis()->ping();
         return $this->repository($store);
     } catch (Exception $e) {
         event('redis.unavailable', null);
         return parent::createFileDriver(\Config::get('cache.stores.file'));
     }
 }
コード例 #3
0
ファイル: _ide_helper.php プロジェクト: xincap/erp
 /**
  * Set the cache key prefix.
  *
  * @param string $prefix
  * @return void 
  * @static 
  */
 public static function setPrefix($prefix)
 {
     \Illuminate\Cache\RedisStore::setPrefix($prefix);
 }
コード例 #4
0
ファイル: RedisCache.php プロジェクト: Devitek/orm
 /**
  * {@inheritdoc}
  */
 protected function doGetStats()
 {
     $stats = $this->store->connection()->info();
     return [Cache::STATS_HITS => isset($stats['keyspace_hits']) ? $stats['keyspace_hits'] : $stats['Stats']['keyspace_hits'], Cache::STATS_MISSES => isset($stats['keyspace_misses']) ? $stats['keyspace_misses'] : $stats['Stats']['keyspace_misses'], Cache::STATS_UPTIME => isset($stats['uptime_in_seconds']) ? $stats['uptime_in_seconds'] : $stats['Server']['uptime_in_seconds'], Cache::STATS_MEMORY_USAGE => isset($stats['used_memory']) ? $stats['used_memory'] : $stats['Memory']['used_memory']];
 }
コード例 #5
0
ファイル: _ide_helper.php プロジェクト: purplebleed/hljtnbdm
 /**
  * Begin executing a new tags operation.
  *
  * @param string $name
  * @return \Illuminate\Cache\TaggedCache 
  * @static 
  */
 public static function section($name)
 {
     //Method inherited from \Illuminate\Cache\TaggableStore
     return \Illuminate\Cache\RedisStore::section($name);
 }
コード例 #6
0
ファイル: Editorial.php プロジェクト: vinelab/agency
 public function __construct(RedisStore $redis)
 {
     $this->redis = $redis;
     $this->client = $redis->connection();
 }
コード例 #7
0
 /**
  * Remove all items from the cache.
  *
  * @return void
  */
 public function flush()
 {
     $isCluster = config('database.redis.cluster');
     if (!$isCluster) {
         parent::flush();
     }
 }
コード例 #8
0
ファイル: Auth.php プロジェクト: vinelab/agency
 public function __construct(Cache $cache, RedisStore $redis)
 {
     $this->cache = $cache;
     $this->redis = $redis->connection();
 }
コード例 #9
0
ファイル: CachingType.php プロジェクト: vinelab/agency
 /**
  * Get a pipeline instance.
  *
  * @return \Predis\Pipeline\PipelineContext
  */
 public function pipeline()
 {
     return $this->store->pipeline();
 }
コード例 #10
0
 /**
  * @param $tags
  *
  * @return void
  */
 public function flush($tags)
 {
     return $this->cache->tags($tags)->flush();
 }