Ferreteria/v0.6/clade/Sys/Data/Engine/endpt/Server/@removed/2026/01/26

From Woozle Writes Code
< Ferreteria‎ | v0.6‎ | clade‎ | Sys‎ | Data‎ | Engine‎ | endpt/Server‎ | @removed
Jump to navigation Jump to search
Code as of 2026-01-26
<?php namespace Woozalia\Ferret\Sys\Data\Engine;
// DOCS: https://wooz.dev/Ferreteria/v0.6/clade/Sys/Data/Engine/Conn

/* Base*      [ca,i] */ use Woozalia\Ferret\IO\Aspect\{ caConnx as BaseClass, iConnx as BaseIface };
/* CredsIface        */ use Woozalia\Ferret\IO\Aspect\iCreds as CredsIface;
/* DoorIface         */ use Woozalia\Ferret\IO\Aspect\iEntry as DoorIface;
/* OperIface         */ use Woozalia\Ferret\Sys\Data\Engine\iOper as OperIface;
/* RostClass         */ use Woozalia\Ferret\Sys\Data\Engine\aux\cDbList as RostClass;
/* SelfIface         */ use Woozalia\Ferret\Sys\Data\Engine\iConn as SelfIface;
/* ServerIface       */ use Woozalia\Ferret\IO\Aspect\aux\endpt\ixServer as ServerIface;
/* SockIface         */ #use Woozalia\Ferret\IO\Aspect\iSocket as SockIface;
/* ViewIface         */ use Woozalia\Ferret\IO\O\iView as ViewIface;

#interface iConn extends BaseIface, HasClsRostIface, HasObjRostIface {
interface iConn extends BaseIface, ServerIface {
    // SETUP
    #static function FromSlug(string $sSlug) : SelfIface;
    // OBJECTS
    function OCreds(?CredsIface $o=NULL) : CredsIface;
    function OOper() : OperIface;
}
abstract class caConn extends BaseClass implements SelfIface {
    #use HasClsRostTrait;
    #use HasObjRostTrait;

    // ++ CONFIG ++ //

    // #[Oper]
    abstract protected function OperClass() : string;
    static protected function RosterClass() : string { return RostClass::class; }  // OVERRIDE

    // -- CONFIG -- //
    // ++ SETUP ++ //

    #protected function __construct(){}

    /* 2026-01-24 system redesign in progress
    // $sSlug is how we look this object up in the Object Registry
    public function __construct(string $sSlug, DoorIface $oDoor) {
        $this->WithSlug($sSlug);
        #$this->WithSocket($oSock);
        #echo $oSock->OJack()->ReflectThis()->Report();
        $this->Connect(NULL,$oDoor->OJack());  // $oSock is the path to the server
    }
    #public function OSock() : SockIface { return $this->oSock; }
    */

    // -- SETUP -- //
    // ++ OBJECTS ++ //

    // 2025-10-23 TODO: Maybe the ViewIface should just use OSock()
    // 2026-01-24 I doubt this will work as-is anymore anyway.
    #public function Inspect() : ViewIface { return new ($this->InspectorClass())($this,$this->OSock(),$this->OSock()->OCred(),$this); }

    private $oCreds=NULL;
    public function OCreds(?CredsIface $o=NULL) : CredsIface { return is_null($o) ? $this->oCreds : ($this->oCreds = $o); }

    private $oOper=NULL;
    public function OOper() : OperIface { return $this->oOper ?? ($this->oOper = $this->OOperNew()); }
    protected function OOperNew() : OperIface {
        $scOper = $this->OperClass();
        $oOper = $scOper::FromConn($this);
        return $oOper;
    }

    // -- OBJECTS -- //
}