Horde_Imsp_Client_Base::receive PHP Method

receive() abstract public method

Receives a single CRLF terminated server response string
abstract public receive ( ) : mixed
return mixed 'NO', 'BAD', 'OK', raw response.
    public abstract function receive();

Usage Example

Ejemplo n.º 1
0
 /**
  * Function sets an option value on the IMSP server.
  *
  * @param string $name  Name of option to set.
  * @param string $value Value to assign.
  *
  * @throws Horde_Imsp_Exception
  */
 public function set($option, $value)
 {
     /* Send the beginning of the command. */
     $this->_imsp->send("SET {$option} ", true, false);
     /* Send $optionValue as a literal {}? */
     if (preg_match(Horde_Imsp_Client_Base::MUST_USE_LITERAL, $value)) {
         $biValue = sprintf("{%d}", strlen($value));
         $result = $this->_imsp->send($biValue, false, true, true);
     }
     /* Now send the rest of the command. */
     $result = $this->_imsp->send($value, false, true);
     $server_response = $this->_imsp->receive();
     if ($server_response != 'OK') {
         throw new Horde_Imsp_Exception('The option could not be set on the IMSP server.');
     }
     $this->_imsp->_logger->debug('SET command OK.');
 }
All Usage Examples Of Horde_Imsp_Client_Base::receive