Ferreteria/v0.6/sys/Config: Difference between revisions

From Woozle Writes Code
Jump to navigation Jump to search
(Created page with "{{fmt/title|Ferreteria Configuration|This page is very much a work in progress.}} ==Database Connections== Example code: {{fmt/php/block|1= <?php namespace Woozalia\Ferret\Config; // BOX: hetz1 →‎ChainClass: use Woozalia\Ferret\IO\Aspect\Connx\Plug\cChain as ChainClass; →‎DbCredClass: use Woozalia\Ferret\IO\Aspect\Creds\Password\cDbase as DbCredClass; →‎HostClass: use Woozalia\Ferret\IO\Aspect\cHost as HostClass; →‎MariaCoClass: use Woozalia\Ferret\Sys\Data\...")
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 43: Line 43:
);
);
}}
}}
What this creates:
<table class=wikitable>
<tr>
  <td></td>
  <td>{{l/ver/clade|IO\Aspect|Host|$oHostB}}: localhost</td>
  <td rowspan=3>&rarr; {{l/ver/clade|IO\Aspect|Socket|$oSockB}}</td>
  <td rowspan=3>&rarr; {{l/ver/clade|Sys\Data\Engine\Conn\MyMar|Maria}} connection object</td>
</tr>
<tr><td></td><td>{{l/ver/clade|IO\Aspect\Creds\Password|Dbase|$oCredB}}: root@{{fmt/arg|pass}}</td></tr>
<tr><td>
<table class=wikitable>
<tr><td>{{l/ver/clade|IO\Aspect|Host|$oHostA}}: hetz1.vbz.ovh</td><td rowspan=3>&rarr; {{l/ver/clade|IO\Aspect|Socket|$oSockA}} &rarr;</td></tr>
<tr><td>{{l/ver/clade|IO\Aspect|Creds|$oCredA}}: root (pubkey)
<tr><td>{{l/ver/clade|IO\Aspect\Connx\Plug\Shell\Remote|SSH|$oConnA}}: remote ssh
</table>
</td><td>{{l/ver/clade|IO\Aspect\Connx\Plug|Chain|$oConnB}}: (chain from $oSockA)</td></tr>
</table>

Latest revision as of 23:42, 22 October 2025

Ferreteria Configuration
This page is very much a work in progress.

Database Connections

Example code:

<?php namespace Woozalia\Ferret\Config;
// BOX: hetz1

/* ChainClass */ use Woozalia\Ferret\IO\Aspect\Connx\Plug\cChain as ChainClass;
/* DbCredClass */ use Woozalia\Ferret\IO\Aspect\Creds\Password\cDbase as DbCredClass;
/* HostClass */ use Woozalia\Ferret\IO\Aspect\cHost as HostClass;
/* MariaCoClass */ use Woozalia\Ferret\Sys\Data\Engine\Conn\MyMar\cMaria as MariaCoClass;
/* PubkeyClass */ use Woozalia\Ferret\IO\Aspect\cCreds as PubkeyClass;
/* ShRemClass */ use Woozalia\Ferret\IO\Aspect\Connx\Plug\Shell\Remote\cSSH as ShRemClass;
/* SockClass */ use Woozalia\Ferret\IO\Aspect\cSocket as SockClass;

//=====
// code-to-remote-shell:
$oHostA = HostClass::FromSpecs('hetz1.vbz.ovh');
$oCredA = new PubkeyClass('root');  // no password needed
$oConnA = ShRemClass::ForSocket();
$oSockA = new SockClass(
  oHost: $oHostA,
  oCred: $oCredA,
  oPlug: $oConnA,
  );

//=====
// remote-shell-to-DB:
$oHostB = $oLocalHost;
$oCredB = new DbCredClass(
    sUser: 'root',
    sPass: $arPass['hetz1']
);
$oConnB = ChainClass::FromSocket($oSockA);
$oSockB = new SockClass(
  oHost: $oHostB,
  oCred: $oCredB,
  oPlug: $oConnB,
  );
new MariaCoClass(
  sSlug: 'hetz1',
  oSock: $oSockB,        // code-to-engine socket
);

What this creates:

$oHostB: localhost $oSockB Maria connection object
$oCredB: root@<pass>
$oHostA: hetz1.vbz.ovh$oSockA
$oCredA: root (pubkey)
$oConnA: remote ssh
$oConnB: (chain from $oSockA)