Ferreteria/v0.6/clade/Sys/Data/Engine/aux/ActionRq/Admin/dbase/EngDbExport: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
{{page/clade/v2 | {{page/clade/v2 | ||
|fam= | |fam= | ||
{{!}} align=right {{!}} {{l/ver/clade|Sys\Data\Engine\aux\ActionRq\Admin|ToDbOper}} | {{!}} align=right {{!}} <code>{{l/ver/clade|Sys\Data\Engine\aux\ActionRq\Admin|ToDbOper}}</code> | ||
{{!}} align=center {{!}} & | {{!}} align=center {{!}} ⇒ <code>{{l/ver/clade|Sys\Data\Engine\aux\ActionRq\Admin\ToDbOper|EngDbExport}}</code> ⇒ | ||
{{!}} align=left {{!}} | {{!}} align=left {{!}} [WFu]<code>{{l/ver/clade|p=futilities|Sys\dba\InReq|DoExport}}</code> | ||
|alia= | |alia= | ||
{{! | {{!-!}} '''Base'''* [ca,i] {{!!}} <code>{{l/ver/clade/full|Sys\Data\Engine\aux\ActionRq\Admin|ToDbOper}}</code> | ||
{{!-!}} '''File'''* [c] {{!!}} <code>{{l/ver/clade/full|Sys\FileSys\Node|Fi}}</code> | |||
{{! | {{!-!}} '''Request'''* [i] {{!!}} <code>{{l/ver/clade/full|Sys\Data\Engine\aux\ActionRq|Admin}}</code> | ||
{{! | |||
}} | }} | ||
== | ==History== | ||
* [[2025/10/08]]: fixing the call to <code>FromParams()</code> | * '''{{fmt/date|2024|12|03}}''' [NOTE] <code>mariadb-dump</code> has an <code>--xml</code> / <code>-X</code> option which outputs in XML. | ||
** {{hashtag|TODO}}: experiment with this. | |||
* '''{{fmt/date|2024|11|22}}''' started | |||
* '''{{fmt/date|2025|01|21}}''' <code>AskEngine()</code> was calling a separate <code>DoDbaseBackup()</code> method right at the end, but I think this was just complicating things and confusing to read -- nothing else calls that. I've recombined them. | |||
* '''{{fmt/date|2025|03|25}}''' moved from <code>AdminRq/</code> to <code>AdminRq/ToDbConn/</code> | |||
* '''{{fmt/date|2025|09|21}}''' renaming from Backup to EngDbExport, for consistency and clarity | |||
* '''[[2025/10/08]]''': fixing the call to <code>{{l/ver/fx|FromParams}}()</code> | |||
* '''{{fmt/date|2025|10|09}}''' Had to split off a trait in order to avoid Go() always overriding Go() from included traits in podlings. | |||
==Code== | ==Code== | ||
''as of 2025 | * [[/@removed/]] | ||
* ''as of {{fmt/date|2025|10|07}}:'' | |||
{{fmt/php/block|1= | {{fmt/php/block|1= | ||
interface iEngDbExport extends BaseIface {} | interface iEngDbExport extends BaseIface {} | ||
Latest revision as of 13:40, 27 November 2025
| ||||||||||||||||||
History
- 2024-12-03 [NOTE]
mariadb-dumphas an--xml/-Xoption which outputs in XML.- #TODO: experiment with this.
- 2024-11-22 started
- 2025-01-21
AskEngine()was calling a separateDoDbaseBackup()method right at the end, but I think this was just complicating things and confusing to read -- nothing else calls that. I've recombined them. - 2025-03-25 moved from
AdminRq/toAdminRq/ToDbConn/ - 2025-09-21 renaming from Backup to EngDbExport, for consistency and clarity
- 2025/10/08: fixing the call to
FromParams() - 2025-10-09 Had to split off a trait in order to avoid Go() always overriding Go() from included traits in podlings.
Code
interface iEngDbExport extends BaseIface {}
abstract class caEngDbExport extends BaseClass implements iEngDbExport {
// ++ CONFIG ++ //
abstract protected function EngScExportRequestClass() : string;
// -- CONFIG -- //
// ++ ACTION ++ //
// CEMENT
public function Go() {
$oScrn = self::Screen();
$oDBC = $this->QDbOper()->GetIt();
$oTplt = $this->FileSpecTemplate();
$oTplt->Lookup()->QEngine()->SetIt($oDBC);
$oTplt = $this->FileSpecTemplate();
$oLook = $oTplt->Lookup(); // filename template
$arSch = $oDBC->SchemaList();
$nSch = count($arSch);
if ($nSch == 0) {
echo $oScrn->ErrorIt('Problem').': no schemas found.'.CRLF;
$ok = FALSE;
} else {
$ok = TRUE;
echo $nSch.' schema'.(($nSch==1)?'':'s').' found.'.CRLF;
foreach ($arSch as $oSchema) {
$oLook->QSchema()->SetIt($oSchema); // provide schema info for template ($oTplt)
$fsData = $oTplt->Render();
$ofData = FileClass::FromSpec($fsData);
#$oSchReq = $this->NewEngScExportRequest();
$sc = $this->EngScExportRequestClass();
echo $sc::ReflectSelf()->Report();
$oSchReq = $sc::FromParams($oSchema,$ofData);
$oSchReq->Go();
}
}
if ($ok) {
echo $oScrn->GreenIt('Ok!').' - Backup complete.'.CRLF;
} else {
echo $oScrn->YellowIt('Note').': - one or more issues were found during backup.'.CRLF;
}
}
// -- ACTION -- //
// ++ OBJECTS ++ //
protected function FileSpecTemplate() : TemplateIface { return FilePaths::Me()->ExportFiTplt(); }
// -- OBJECTS ++ //
}