/** * Parse response * * @param array|string $response * @return mixed */ public function parseResponse($response) { if (!is_array($this->keyOrKeys) && !empty($response)) { $result = $this->_rediska->getSerializer()->unserialize($response[1]); } else { $result = Rediska_Command_Response_ListNameAndValue::factory($this->_rediska, $response); } return $result; }
/** * Parse response * * @param string|array $response * @return mixed */ public function parseResponse($response) { if ($this->pushToKey !== null) { if (empty($response)) { return null; } if (!$this->isAtomic()) { $command = array('LPUSH', $this->_rediska->getOption('namespace') . $this->pushToKey, $response[1]); $exec = new Rediska_Connection_Exec($this->_storeConnection, $command); $exec->execute(); $value = $response[1]; } else { $value = $response; } return $this->_rediska->getSerializer()->unserialize($value); } else { if (!is_array($this->keyOrKeys) && !empty($response)) { $result = $this->_rediska->getSerializer()->unserialize($response[1]); } else { $result = Rediska_Command_Response_ListNameAndValue::factory($this->_rediska, $response); } return $result; } }