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