Ferreteria/v0.6/clade/IO/Aspect/Connx/Plug/Shell: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| 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== | ==Pages== | ||
* {{l/sub|@removed}} | * {{l/sub|@removed}} | ||
Latest revision as of 14:22, 31 October 2025
| ||||||||||||||||||||||
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 -- //
}