Ferreteria/v0.6/clade/IO/Aspect/Connx/Stream/Runner/@fx/DoCommand

From Woozle Writes Code
< Ferreteria‎ | v0.6‎ | clade‎ | IO‎ | Aspect‎ | Connx‎ | Stream‎ | Runner
Jump to navigation Jump to search

About

History

  • 2024-11-24 created. This is experimental; if it works,
    • This kind of thing should probably be encapsulated in its own class.
      • 2026-01-17 I think what I meant by that is what eventually happened: this code now mostly just calls Process->DoCommand()
  • 2024-11-25 moved from shell/Secure to Shell
  • 2025-03-21 moved core code from Shell to Process::Run(); this now calls that.
  • 2025-12-24 We now have the requested OpIface copy whatever comes from Proc->Run() so we can be sure it's the class the caller needs.
    • xTODO: Maybe the caller should do this check, since they think it's so bloody important...
  • 2025-12-28 removing the optional $oAct param and just returning what Run() returns, because it has specific important info in it
    • (This satisfies the 12/24 xTODO.)
  • 2026-01-20 commented out, with the note "should this even be implemented here?"
  • 2026-01-31
    • determined that the answer is "yes"
    • renamed Shell to Runner

Code: current

As of 2026-01-31 (probably needs revision -- actual execution should be implemented in a podling):

#
    public function DoCommand(CmdLineIface $oCmd) : ResultIface {
        $oProc = $this->OProcess();
        $oProc->RunCommand($oCmd);
        return $oProc->OResult();
    }

Code: removed

2026-01-17

#
    // 2026-01-11 old API
    public function DoCommand(CmdLineIface $oCmd, StreamIface $oResps) : CommOpIface {
        $oProc = ProcClass::FromCommand($oCmd);
        $oProc->RecverStream($oResps);

        $oAct = $oProc->Run($oCmd);
        $oProc->SetOpStator($oAct);
        return $oAct;
    }