Open Poltavtcev opened 9 months ago
In the function RestoreBackup
, I added the following code before the point where the new version is saved to the version.txt
file to execute the undo scripts:
if (file_exists($yamlFile)) {
$spyc = Spyc::YAMLLoad($yamlFile);
if (array_key_exists("scripts", $spyc) && is_array($spyc['scripts'])) {
foreach ($spyc["scripts"] as $script) {
$scriptPath = $restoreTo . '/' . $script['script'];
if (file_exists($scriptPath)) {
include($scriptPath);
if ($script['delete']) {
unlink($scriptPath);
}
}
}
}
}
Failed to get the undo scripts working. Also, I don't see a function that would execute scripts from the restore.yml file.