From 3f5eee316da25ec54c58fb439b208700fc7696c2 Mon Sep 17 00:00:00 2001 From: Daniel Neto Date: Thu, 25 Jul 2024 18:05:44 -0300 Subject: [PATCH] Update --- install/mysqlRestore.php | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/install/mysqlRestore.php b/install/mysqlRestore.php index 5ffd499f04f1..430f55a9bcee 100644 --- a/install/mysqlRestore.php +++ b/install/mysqlRestore.php @@ -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"; @@ -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) {