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 2a8554d commit 34006bc
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions install/mysqlRestore.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,21 @@
$doNotIncludeConfig = 1;
require_once __DIR__.'/../videos/configuration.php';

if (php_sapi_name() !== 'cli') {
return die('Command Line only');
}

$global['mysqli'] = new mysqli($mysqlHost, $mysqlUser, $mysqlPass, '', @$mysqlPort);
$createSQL = "DROP DATABASE {$mysqlDatabase};";
$global['mysqli']->query($createSQL);
try {
$createSQL = "DROP DATABASE {$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);

if (php_sapi_name() !== 'cli') {
return die('Command Line only');
}

ob_end_flush();

$globPattern = "{$global['systemRootPath']}videos/mysqldump-*.sql";
Expand Down

0 comments on commit 34006bc

Please sign in to comment.