Ferreteria/v0.6/clade/IO/Aspect/Connx/Plug/Shell/Remote/SSH/@fx/DoCommand
Jump to navigation
Jump to search
About
- Assumes: connection has been opened
History
- 2026-01-09 THINKING: It doesn't really make sense to pass in a Stream here, since
ssh2_exec()creates one.- Also,
$oItWenthas twoStrobjects for receiving data -- one for regular replies, one for errors. - So: we could either create an
ItWentpodling that encapsulates reply & error streams, or...- ...we could just
PullBytes()from the returned stream, and stuff them into the replyQStr. - ...ohbutwait! That must be what
$oItWent = $oStream->PullBytes()does, except we need to create & set up$oStream.
- ...we could just
- Also,
Code
as of 2026-01-09 (revision still in progress):
#
public function DoCommand(CmdLineIface $oCmd, StreamIface $oResps) : CommOpIface {
$rRecv = ssh2_exec($this->QNative()->GetIt(), $oCmd->AsString());
$oItWent = $oStream->PullBytes();
$oItWent->SetOkay(is_resource($rRecv));
return $oItWent;
}