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


PHP Client::get方法代码示例

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


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

示例1: read

 /**
  * {@inheritdoc}
  */
 public function read($sessionId)
 {
     if ($dataSet = $this->client->get("wandu.http.sess.{$sessionId}")) {
         return unserialize($dataSet);
     }
     return [];
 }
开发者ID:Golpha,项目名称:Http,代码行数:10,代码来源:RedisAdapter.php

示例2: checkIfUsernameExists

 /**
  * @param $username
  *
  * @return bool
  */
 private function checkIfUsernameExists($username)
 {
     if ($this->redisClient->get("username:{$username}:id")) {
         return true;
     }
     return false;
 }
开发者ID:KrunoKnego,项目名称:Symfony-Twitter-Clone,代码行数:12,代码来源:RedisRegistration.php

示例3: read

 /**
  * {@inheritdoc}
  */
 public function read($sessionId)
 {
     if ($dataSet = $this->client->get("wandu.http.sess.{$sessionId}")) {
         return $dataSet;
     }
     return '';
 }
开发者ID:wandu,项目名称:http,代码行数:10,代码来源:RedisHandler.php

示例4: load

 /**
  * {@inheritdoc}
  */
 public function load()
 {
     $contents = $this->client->get($this->key);
     if ($contents) {
         $this->setFromStorage($contents);
     }
 }
开发者ID:luoshulin,项目名称:falcon,代码行数:10,代码来源:Predis.php

示例5: doFetch

 /**
  * {@inheritdoc}
  */
 protected function doFetch($id)
 {
     $result = $this->client->get($id);
     if (null === $result) {
         return false;
     }
     return unserialize($result);
 }
开发者ID:samrahman,项目名称:providence,代码行数:11,代码来源:PredisCache.php

示例6: get

 /**
  * @param $key
  * @return Password|null
  */
 public function get($key)
 {
     $password = null;
     if ($passwordData = $this->client->get($key)) {
         $password = $this->getPasswordFromJson($passwordData);
     }
     return $password;
 }
开发者ID:felixsand,项目名称:phpsst,代码行数:12,代码来源:RedisStorage.php

示例7: get

 /**
  * Get a variable
  *
  * @param string $key
  * @param mixed  $default
  * @return mixed
  */
 public function get($key, $default = null)
 {
     if ($this->client->exists($this->namespace . $key)) {
         return $this->client->get($this->namespace . $key);
     } else {
         return $default;
     }
 }
开发者ID:bravo3,项目名称:workflow,代码行数:15,代码来源:RedisMemoryPool.php

示例8: fetch

 /**
  * {@inheritdoc}
  */
 public function fetch($id)
 {
     $result = $this->client->get($this->prefix . $id);
     if (null === $result) {
         return false;
     }
     return $result;
 }
开发者ID:rsrodrig,项目名称:MeetMeSoftware,代码行数:11,代码来源:PredisDriver.php

示例9: read

 /**
  * @param string $sessionId
  *
  * @return string|null
  */
 public function read($sessionId)
 {
     $key = $this->keyPrefix . $sessionId;
     $startTime = microtime(true);
     $result = $this->connection->get($key);
     $this->newRelicApi->addCustomMetric(self::METRIC_SESSION_READ_TIME, microtime(true) - $startTime);
     return $result ? json_decode($result, true) : '';
 }
开发者ID:spryker,项目名称:Session,代码行数:13,代码来源:SessionHandlerRedis.php

示例10: checkReadFromStorage

 /**
  * @return void
  */
 private function checkReadFromStorage()
 {
     try {
         $this->client->get(self::KEY_HEARTBEAT);
     } catch (\Exception $e) {
         $this->addDysfunction(self::HEALTH_MESSAGE_UNABLE_TO_READ_FROM_STORAGE);
         $this->addDysfunction($e->getMessage());
     }
 }
开发者ID:spryker,项目名称:Heartbeat,代码行数:12,代码来源:StorageHealthIndicator.php

示例11: find

 /**
  * @param $jobId
  *
  * @return AbstractJob
  */
 public function find($jobId)
 {
     $data = $this->redis->get($this->namespace . $jobId);
     $data = json_decode($data, true);
     $jobClass = $data[AbstractJob::P_JOB_CLASS];
     /** @var AbstractJob $job */
     $job = new $jobClass($data);
     return $job;
 }
开发者ID:sunnyct,项目名称:cronario,代码行数:14,代码来源:Redis.php

示例12: getUpdatedAt

 /**
  * {@inheritdoc}
  */
 public function getUpdatedAt()
 {
     if ($this->client->exists('migraine:date')) {
         $date = new \DateTime();
         $date->setTimestamp(intval($this->client->get('migraine:date')));
         return $date;
     }
     return null;
 }
开发者ID:jiabin,项目名称:migraine,代码行数:12,代码来源:RedisType.php

示例13: getItem

 /**
  * @param string $key
  * @return \SplitIO\Component\Cache\Item
  */
 public function getItem($key)
 {
     $item = new Item($key);
     $redisItem = $this->client->get($key);
     if ($redisItem !== null) {
         $item->set($redisItem);
     }
     return $item;
 }
开发者ID:splitio,项目名称:php-client,代码行数:13,代码来源:PRedis.php

示例14: isCached

 /**
  * {@inheritDoc}
  */
 public function isCached($providerName, $query)
 {
     if (!$this->redis->exists($key = $this->getKey($providerName, $query))) {
         return false;
     }
     $cached = new BatchGeocoded();
     $cached->fromArray($this->deserialize($this->redis->get($key)));
     return $cached;
 }
开发者ID:toin0u,项目名称:geotools,代码行数:12,代码来源:Redis.php

示例15: indexAction

 /**
  * @param Request $request
  *
  * @return \Symfony\Component\HttpFoundation\Response
  */
 public function indexAction(Request $request)
 {
     $certificationCounter = [];
     foreach ($this->certificationManager->getCertifications() as $cn => $label) {
         $certificationCounter[$cn] = ['metrics' => (int) $this->redisClient->get($cn), 'label' => $label, 'icon' => $this->certificationManager->getContext($cn)->getIcons()];
     }
     $response = $this->engine->renderResponse('@CertificationyWeb/Site/homepage.html.twig', ['count_members' => (int) $this->userRepository->countMembers(), 'certification_done' => (int) $this->redisClient->get('total'), 'certification_counters' => $certificationCounter]);
     return $response;
 }
开发者ID:puterakahfi,项目名称:certificationy-web-platform,代码行数:14,代码来源:SiteController.php


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