Ferreteria/v0.6/clade/IO/Aspect/Connx/Plug/Shell: Difference between revisions

From Woozle Writes Code
< Ferreteria‎ | v0.6‎ | clade‎ | IO‎ | Aspect‎ | Connx‎ | Plug
Jump to navigation Jump to search
(Created page with "{{page/clade/v2 |fam= {{!}} align=right {{!}} {{l/ver/clade|IO\Aspect\Connx|Plug}} {{!}} align=center {{!}} → {{l/ver/clade|IO\Aspect\Connx\Plug|Shell}} → {{!}} align=left {{!}} {{l/ver/clade|IO\Aspect\Connx\Plug\Shell|Local}}<br> {{l/ver/clade|IO\Aspect\Connx\Plug\Shell|Remote}} |alia= {{!-!}} '''BufferIface''' {{!!}} {{l/ver/clade/full|p=ferreteria|IO\Aspect\Connx|Buffer}} {{!-!}} '''MemBuffClass''' {{!!}} {{l/ver/clade/full|p=ferreteria|IO\Aspect\Connx\Buf...")
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 14: Line 14:
{{!-!}} '''SelfIface'''    {{!!}} {{l/ver/clade/full|p=ferreteria|IO\Aspect\Connx\Plug|Shell}}
{{!-!}} '''SelfIface'''    {{!!}} {{l/ver/clade/full|p=ferreteria|IO\Aspect\Connx\Plug|Shell}}
}}
}}
==About==
* PURPOSE: abstraction of a command-shell connection
**  ...so that we can encapsulate the idea of a tunnel
**  ...but DB Connections will treat remote the same as local.
==History==
* '''{{fmt/date|2024|10|31}}''' started
* '''{{fmt/date|2024|11|19}}''' moved from [WFe]Config\Def\Connex -> [WFe]IO\Connx\Shell as part of Def/actor integration
* '''{{fmt/date|2025|05|27}}''' moved from [WFe]IO\Connx -> [WFe]IO\Aspect\Connx
* '''{{fmt/date|2025|06|04}}''' moved from [WFe]IO\Aspect\Connx -> [WFe]IO\Aspect\Connx\Plug
==Pages==
* {{l/sub|@removed}}
==Code==
==Code==
''as of 2025-10-31''
''as of 2025-10-31''

Latest revision as of 14:22, 31 October 2025

clade: IO\Aspect\Connx\Plug\Shell
Clade Family
Plug Shell

Local
Remote

Clade Aliases
Alias Clade
BufferIface IO\Aspect\Connx\Buffer
MemBuffClass IO\Aspect\Connx\Buffer\InMem
Base* [ca,i] IO\Aspect\Connx\Plug
ProcIface IO\Aspect\Connx\Process
SelfIface IO\Aspect\Connx\Plug\Shell
Subpages

About

  • PURPOSE: abstraction of a command-shell connection
    • ...so that we can encapsulate the idea of a tunnel
    • ...but DB Connections will treat remote the same as local.

History

  • 2024-10-31 started
  • 2024-11-19 moved from [WFe]Config\Def\Connex -> [WFe]IO\Connx\Shell as part of Def/actor integration
  • 2025-05-27 moved from [WFe]IO\Connx -> [WFe]IO\Aspect\Connx
  • 2025-06-04 moved from [WFe]IO\Aspect\Connx -> [WFe]IO\Aspect\Connx\Plug

Pages

Code

as of 2025-10-31

interface iShell extends BaseIface {
    // LIFECYCLE
    function Open() : ActionIface;
    function Shut() : ActionIface;
    // OUTPUT
    #{I} function DescribeInline() : string;
}
abstract class caShell extends BaseClass implements SelfIface {

    // ++ OBJECTS ++ //

    protected function NewAction() : ActionIface { return new ($this->ActionClass()); }

    // -- OBJECTS -- //
    // ++ ACTION ++ //

    /**
     * ACTION: Sends a command, buffers the response, closes the command process
     * 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
     *  2025-03-21 moved core code from Shell to Process::Run(); this now calls that.
     */
    public function DoCommand(string|array $saCmd, BufferIface $oBuff, ?CommOpIface $oAct=NULL) : CommOpIface {
        $oProc = ProcClass::FromCommand($saCmd);
        $oProc->SetRecvBuff($oBuff);
        if (is_null($oAct)) {
            $oAct = $this->NewAction();
        }
        $oProc->SetOpStator($oAct);

        return $oProc->Run();
    }
    public function OpenProcess(string|array $saCmd) : ProcIface {
        $oProc = ProcClass::FromCommand($saCmd);
        $oAct = $this->NewAction();
        $oProc->SetOpStator($oAct);
        return $oProc;
    }

    // -- ACTION -- //
}