Ferreteria/v0.6/clade/IO/Aspect/Connx/Stream/Runner/Local/@fx/DoCommand
Jump to navigation
Jump to search
About
- Action: Opens a process to execute the command (
$o) and returns the results.- If an output stream object is specified (in
QRecver(), that is used to capture the output. - The command-string actually gets sent by
ActualOpen(), invoked byOpen().
- If an output stream object is specified (in
History
- 2024-11-24 created. This is experimental; if it works, this kind of thing should probably be encapsulated in its own class.
- 2024-11-25 moved from shell/Secure to Shell
- 2026-01-20 was
Run(); renamed toDoCommand(it already matched the definition)
Code
#
public function Run() : CommOpObjIface {
$this->Open();
$oBuffErrs = $this->GetErrsBuff(); // new in-mem buffer for any errors
$oBuffRecv = $this->RecverStream(); // new in-mem buffer for any responses
$oBuffErrs->Open();
$oBuffRecv->Open();
$oaPipes = $this->OAPipes();
$oAct = $this->PipeToStream(TRUE); // send from... something to something... (2026-01-04 sorting this out)
$this->Shut();
$oBuffRecv->Shut();
$oBuffErrs->Shut();
return $oAct;
}
Obsolete
This and PipeToStream() (which it calls) have a lot of overlap with what Convey() does, and I'm trying to figure out if they can be consolidated.
- Q1: what is the relationship between a
Bufferand aStream?- A: Tentatively, a
Bufferis actually a type ofStream-- so we should be able to pass aBufferwherever aStreamis needed.
- A: Tentatively, a
- Q2: What is the relationship between
GetErrsBuff()and$oaPipes->ErrsQRes()?- A:
GetErrsBuff()returns aBufferobject, which is a type ofStream.$oaPipes->ErrsQRes()returns aQPipeobject, which wraps around a native resource.
- A: