Ferreteria/v0.6/clade/IO/Aspect/Socket: Difference between revisions

From Woozle Writes Code
< Ferreteria‎ | v0.6‎ | clade‎ | IO‎ | Aspect
Jump to navigation Jump to search
(Created page with "{{page/clade/v2 |fam= {{!}} align=right {{!}} {{l/ver/clade|IO|Aspect}} {{!}} align=center {{!}} → {{l/ver/clade|IO/Aspect|Socket}} → {{!}} align=left {{!}} ''(none)'' |alia= {{!}}- {{!}} '''Base'''* [ca,i] {{!!}} {{l/ver/clade/full|p=ferreteria|IO|Aspect}} {{!}}- {{!}} '''PlugIface''' {{!!}} {{l/ver/clade/full|p=ferreteria|IO\Aspect\Connx|Plug}} {{!}}- {{!}} '''CredIface''' {{!!}} {{l/ver/clade/full|p=ferreteria|IO\Aspect|Creds}} {{!}}- {{!}} '''HostIfa...")
 
No edit summary
 
Line 25: Line 25:
* '''{{fmt/date|2025|05|26}}''' started, as part of separating out the different pieces so I can define multiple users on a Host
* '''{{fmt/date|2025|05|26}}''' started, as part of separating out the different pieces so I can define multiple users on a Host
* '''{{fmt/date|2025|05|27}}''' re-namespacing
* '''{{fmt/date|2025|05|27}}''' re-namespacing
 
==Functions==
* <code>public function {{l/ver/fx|OHost}}() : {{l/ver/clade|IO\Aspect|Host|HostIface}}</code>
* <code>public function {{l/ver/fx|OCred}}() : {{l/ver/clade|IO\Aspect|Creds|CredIface}}</code>
* <code>public function {{l/ver/fx|OPlug}}() : {{l/ver/clade|IO\Aspect\Connx|Plug|PlugIface}};</code>
==Code==
==Code==
''as of 2025-10-21''
''as of 2025-10-21''

Latest revision as of 14:50, 31 October 2025

clade: IO\Aspect\Socket
Clade Family
Aspect Socket (none)
Clade Aliases
Alias Clade
Base* [ca,i] IO\Aspect
PlugIface IO\Aspect\Connx\Plug
CredIface IO\Aspect\Creds
HostIface IO\Aspect\Host
SelfIface IO\Aspect\Socket
Subpages

About

  • PURPOSE: encapsulates all the pieces of a connection from one point to another

This is kind of the "umbrella" class for managing objects of the other classes.

History

  • 2025-05-26 started, as part of separating out the different pieces so I can define multiple users on a Host
  • 2025-05-27 re-namespacing

Functions

Code

as of 2025-10-21

interface iSocket extends BaseIface {
    // SETUP
    // ACCESS
    function OHost() : HostIface;
    function OCred() : CredIface;
    function OPlug() : PlugIface;
}
class cSocket extends BaseClass implements SelfIface {

    // ++ SETUP ++ //

    public function __construct(private HostIface $oHost, private CredIface $oCred, private PlugIface $oPlug){
        $oPlug->DefaultSocket($this);
    }
    public function OHost() : HostIface { return $this->oHost; }
    public function OCred() : CredIface { return $this->oCred; }
    public function OPlug() : PlugIface { return $this->oPlug; }

    // -- SETUP -- //
    // ++ OUTPUT ++ //

    public function DescribeInline() : string {
        #$oScrn = self::Screen();
        $sUser = $this->OCred()->DescribeInline();
        $sHost = $this->OHost()->DescribeInline();
        return "$sUser@$sHost";
    }

    // -- OUTPUT -- //
}

Removed

2025-06-04

Commented out yesterday:

// 2025-06-03 old
    static public function FromObjects(HostIface $oHost, CredsIface $oCreds) : SelfIface {
    #static public function FromObjects(HostIface $oHost, CredsIface $oCreds, ConnxIface $oConnx) : SelfIface {
        $oThis = new static;
        #$oThis->WithHost($oHost);
        #$oThis->WithCreds($oCreds);
        #$oThis->WithConnx($oConnx);
        #$oThis->QOConnx()->SetIt($oConnx);
        $oThis->QOCreds()->SetIt($oCreds);
        $oThis->QOHost()->SetIt($oHost);
        return $oThis;
    }

    // -- SETUP -- //
    // ++ ACCESS ++ //

    private $ooCred = NULL; public function QOCreds() : QObjIface { return $this->ooCred ?? ($this->ooCred = QObjClass::AsNew()); }
    #private $ooCnnx = NULL; public function QOConnx() : QObjIface { return $this->ooCnnx ?? ($this->ooCnnx = QObjClass::AsNew()); }
    private $ooHost = NULL; public function QOHost()  : QObjIface { return $this->ooHost ?? ($this->ooHost = QObjClass::AsNew()); }

    // -- ACCESS -- //