當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CommandInterface::parseResponse方法代碼示例

本文整理匯總了PHP中Predis\Command\CommandInterface::parseResponse方法的典型用法代碼示例。如果您正苦於以下問題:PHP CommandInterface::parseResponse方法的具體用法?PHP CommandInterface::parseResponse怎麽用?PHP CommandInterface::parseResponse使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Predis\Command\CommandInterface的用法示例。


在下文中一共展示了CommandInterface::parseResponse方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: onResponseObject

 /**
  * Handles a response object.
  *
  * @param  ConnectionInterface     $connection
  * @param  CommandInterface        $command
  * @param  ResponseObjectInterface $response
  * @return mixed
  */
 protected function onResponseObject(ConnectionInterface $connection, CommandInterface $command, ResponseObjectInterface $response)
 {
     if ($response instanceof ResponseErrorInterface) {
         return $this->onResponseError($connection, $response);
     }
     if ($response instanceof Iterator) {
         return $command->parseResponse(iterator_to_array($response));
     }
     return $response;
 }
開發者ID:kchhainarong,項目名稱:chantuchP,代碼行數:18,代碼來源:StandardExecutor.php

示例2: onErrorResponse

 /**
  * Handles -ERR responses returned by Redis.
  *
  * @param CommandInterface       $command  Redis command that generated the error.
  * @param ErrorResponseInterface $response Instance of the error response.
  *
  * @throws ServerException
  *
  * @return mixed
  */
 protected function onErrorResponse(CommandInterface $command, ErrorResponseInterface $response)
 {
     if ($command instanceof ScriptCommand && $response->getErrorType() === 'NOSCRIPT') {
         $eval = $this->createCommand('EVAL');
         $eval->setRawArguments($command->getEvalArguments());
         $response = $this->executeCommand($eval);
         if (!$response instanceof ResponseInterface) {
             $response = $command->parseResponse($response);
         }
         return $response;
     }
     if ($this->options->exceptions) {
         throw new ServerException($response->getMessage());
     }
     return $response;
 }
開發者ID:sohel4r,項目名稱:wordpress_4_1_1,代碼行數:26,代碼來源:predis.php

示例3: readResponse

 /**
  * {@inheritdoc}
  */
 public function readResponse(CommandInterface $command)
 {
     $reply = $this->read();
     if ($reply instanceof ResponseObjectInterface) {
         return $reply;
     }
     return $command->parseResponse($reply);
 }
開發者ID:rubensayshi,項目名稱:predis,代碼行數:11,代碼來源:AbstractConnection.php


注:本文中的Predis\Command\CommandInterface::parseResponse方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。