Ferreteria/v0.6/clade/IO/Aspect/Connx/Plug/Shell/Remote

From Woozle Writes Code
< Ferreteria‎ | v0.6‎ | clade‎ | IO‎ | Aspect‎ | Connx‎ | Plug‎ | Shell
Jump to navigation Jump to search
clade: IO\Aspect\Connx\Plug\Shell\Remote
Clade Family
Shell Remote SSH
Clade Aliases
Alias Clade
Base* [ca,i] IO\Aspect\Connx\Plug\Shell
CredsIface IO\Aspect\Creds
TunnelIface IO\Aspect\Connx\aux\Tunnel
Subpages

About

  • Purpose: a shell connection to a remote machine

History

  • 2025-03-15 rebuilding, code was in the ItWent class, how did this ever even work??

Code

Current

as of 2025-12-10:

interface iRemote extends BaseIface {
    function NewTunnel(CredsIface $oICreds, ?int $nPortLocal=NULL) : TunnelIface;
}
abstract class caRemote extends BaseClass implements iRemote {}

Removed

2025-05-27

Commented out on 2025-03-16:

#
    // ++ ACTION ++ //

    // 2025-03-16 This succeeds in opening the tunnel (if sudo is invoked), but then the tunnel isn't used.
    public function DoCommand(string|array $sCmd, BufferIface $oBuff) : CommOpIface {
        $oScrn = $this->Screen();
        $oAct = $this->NewAction();
        #echo $this->Creds()->ReflectThis()->Report();


        // ++ TUNNEL
        #echo "Opening tunnel to $sSHost...".CRLF;

        // 2025-03-16 If this works, then I think it must be an accidental kluge from earlier. TODO: fix later.
        $oCreds = $this->Creds();

        $oTunn = $this->NewTunnel($oCreds);
        $oAct = $oTunn->Open();
        echo ($oAct->GetOkay() ? $oScrn->GreenIt('Opened.') : ($oScrn->ErrorIt('Error: ').$oAct->GetMessage())).CRLF;

        // -- TUNNEL

        $oAct = parent::DoCommand($sCmd,$oBuff);  // NOT TESTED
        return $oAct;
    }

    // -- ACTION -- //