Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Neto committed Jul 25, 2024
1 parent 6d456fc commit 3f5eee3
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions install/mysqlRestore.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,6 @@
return die('Command Line only');
}

$global['mysqli'] = new mysqli($mysqlHost, $mysqlUser, $mysqlPass, '', @$mysqlPort);
try {
$createSQL = "DROP DATABASE IF EXISTS {$mysqlDatabase};";
$global['mysqli']->query($createSQL);
} catch (\Throwable $th) {
echo ($th->getMessage());
}
$createSQL = "CREATE DATABASE IF NOT EXISTS {$mysqlDatabase};";
$global['mysqli']->query($createSQL);
$global['mysqli']->select_db($mysqlDatabase);

ob_end_flush();

$globPattern = "{$global['systemRootPath']}videos/mysqldump-*.sql";
Expand Down Expand Up @@ -51,6 +40,18 @@
echo PHP_EOL . "Backup file created at {$file}" . PHP_EOL;
*/

$global['mysqli'] = new mysqli($mysqlHost, $mysqlUser, $mysqlPass, '', @$mysqlPort);
try {
$createSQL = "DROP DATABASE IF EXISTS {$mysqlDatabase};";
$global['mysqli']->query($createSQL);
} catch (\Throwable $th) {
echo ($th->getMessage());
}
$createSQL = "CREATE DATABASE IF NOT EXISTS {$mysqlDatabase};";
$global['mysqli']->query($createSQL);
$global['mysqli']->select_db($mysqlDatabase);

executeFile($filename);

function executeFile($filename) {
Expand Down

0 comments on commit 3f5eee3

Please sign in to comment.