public interactiveRead ( ) : string | ||
return | string |
function interactiveRead()
{
if (!($this->bitmap & self::MASK_LOGIN)) {
throw new \RuntimeException('Operation disallowed prior to login()');
}
if (!($this->bitmap & self::MASK_SHELL) && !$this->_initShell()) {
throw new \RuntimeException('Unable to initiate an interactive shell session');
}
$read = array($this->fsock);
$write = $except = null;
if (stream_select($read, $write, $except, 0)) {
$response = $this->_get_binary_packet();
return substr($response[self::RESPONSE_DATA], 4);
} else {
return '';
}
}