From 5ae1a2827728e5adaeef901a32d7c34f3e56c58d Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Wed, 18 Jan 2023 17:39:12 +0100 Subject: [PATCH] #10138 change system error in step 4 --- pandora_console/install.php | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/pandora_console/install.php b/pandora_console/install.php index be9ffb0865..ba5c7f60bf 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -333,9 +333,10 @@ function parse_mysqli_dump($connection, $url) $query .= $sql_line; if (preg_match("/;[\040]*\$/", $sql_line)) { if (!$result = mysqli_query($connection, $query)) { - echo mysqli_error($connection); - // Uncomment for debug - echo "
$query
"; + if (mysqli_error($connection)) { + return mysqli_error($connection).'
'.$query.'
'; + } + return 0; } @@ -888,7 +889,7 @@ function install_step4() $step5 = 0; $step6 = 0; $step7 = 0; - + $errors = []; echo "
@@ -1036,13 +1037,21 @@ function install_step4() if ($step1 == 1) { $step2 = mysqli_select_db($connection, $dbname); check_generic($step2, "Opening database '$dbname'"); - echo '
'; + $step3 = parse_mysqli_dump($connection, 'pandoradb.sql'); - echo '
'; + + if ($step3 !== 0) { + $errors[] = $step3; + } + check_generic($step3, 'Creating schema'); - echo '
'; + $step4 = parse_mysqli_dump($connection, 'pandoradb_data.sql'); - echo '
'; + + if ($step4 !== 0) { + $errors[] = $step4; + } + check_generic($step4, 'Populating database'); if (PHP_OS == 'FreeBSD') { $step_freebsd = adjust_paths_for_freebsd($engine, $connection);