Ferreteria/v0.6/clade/Sys/Data/Engine/aux/ActionRq/Admin

From Woozle Writes Code
< Ferreteria‎ | v0.6‎ | clade‎ | Sys‎ | Data‎ | Engine‎ | aux‎ | ActionRq
Jump to navigation Jump to search
clade: Sys\Data\Engine\aux\ActionRq\Admin
Clade Family

[c,i] ActionRq
[t] Schema

Admin
Clade Aliases
Alias Clade
Base* [c,i] Sys\Data\Engine\aux\ActionRq
DbConnAdmin Sys\Data\Engine\Conn
Subpages

History

Code

as of 2025-10-17:

interface iAdmin extends BaseIface, HasSchemaIface {
    function Go();
}
trait tAdmin {
    use HasSchemaTrait;

    // ++ OUTPUT ++ //

    public function ListHosts() : string {

        $oScrn = self::Screen();

        #$oaDBs = DbConnAdmin::Register();
        $oaDBs = $this->DbasesOArray();
        #echo $this->ReflectThis()->Report();
        echo $oaDBs->ReflectThis()->Report();

        $nDBs = $oaDBs->Count();
        if ($nDBs > 0) {
            $oTable = $oScrn->NewTable();
            $sS = ($nDBs == 1) ? '' : 's';
            $sOut = $oScrn->InfoIt($nDBs)." available DB connection$sS:".CRLF;
            $oHdr = $oTable->RowFromData(['name','specs']);
            $oHdr->IsHeader(TRUE);
            $oaDBs->RewindMe();
            foreach ($oaDBs as $sKey => $oConn) {
                #echo "[$sKey] DB CLASS: ".get_class($oConn).CRLF;
                $sVal = (is_null($oConn) ? '(BUG: missing!)' : $oConn->DescribeInline());
                $arRow = [$sKey,$sVal];
                $oTable->RowFromData($arRow);
            }
            $sOut .= $oTable->Render();
        } else {
            $sOut = 'No database connections are defined yet.'.CRLF;
        }
        return $sOut;
    }

    // -- OUTPUT -- //
}
abstract class caAdmin extends BaseClass implements iAdmin {
    use tAdmin;
}

Removed Code

2025-09-21

Commented out awhile back -- possibly this stuff got moved into the appropriate traits:

// ++ ACCESS: objects ++ //

    private $oConn=NULL;
    #private $sEng=NULL;
    protected function HasDbConn() : bool { return is_object($this->oConn); }
#    protected function EngineSlug(string $s=NULL) : string { return $this->sEng; }

    private $oSch=NULL;
    private $sSch=NULL;
    protected function HasSchema() : bool { return is_object($this->oSch); }
    protected function SchemaName(string $s=NULL) : string { return $this->sSch; }

    // -- ACCESS -- //