Example #1
0
 /**
  * @param Integer $timeout
  * @return array
  */
 public function get($timeout = 0)
 {
     if ($this->resp === null) {
         // If we already read the response during an earlier call for different id, just return it
         if ($this->state == self::REQ_STATE_OK || $this->state == self::REQ_STATE_ERR) {
             return $this->resp;
         }
         $this->conn->waitForResponse($this->reqID, $timeout);
         $this->resp = self::formatResponse($this->stdout, $this->stderr);
     }
     return $this->resp;
 }