/**
* 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.');
}