Ferreteria/v0.6/clade/IO/Aspect/Socket
< Ferreteria | v0.6 | clade | IO | Aspect
Jump to navigation
Jump to search
| ||||||||||||||||||||||
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
public function OHost() : HostIfacepublic function OCred() : CredIfacepublic function OPlug() : PlugIface;
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 -- //