From b377cba42115d6208008ab24881b2d002a090e68 Mon Sep 17 00:00:00 2001 From: Daniel Neto Date: Sun, 28 Jul 2024 08:52:32 -0300 Subject: [PATCH] Update --- install/mysqlRestore.php | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/install/mysqlRestore.php b/install/mysqlRestore.php index 82ef6cc81e6d..a1124d030618 100644 --- a/install/mysqlRestore.php +++ b/install/mysqlRestore.php @@ -100,38 +100,35 @@ function executeFile($filename) { // Executar DROP TABLE IF EXISTS separado de CREATE TABLE foreach ($tables as $table) { $dropTableCommand = 'DROP TABLE IF EXISTS `' . $table . '`;'; - echo "Executing: $dropTableCommand\n"; // Imprimir o comando SQL try { if (!$global['mysqli']->query($dropTableCommand)) { throw new Exception($global['mysqli']->error); } } catch (Exception $e) { - echo ('sqlDAL::executeFile ' . $filename . ' Error performing query \'' . $dropTableCommand . '\': ' . $e->getMessage() . '

'); + echo 'sqlDAL::executeFile ' . $filename . ' Error performing query \'' . $dropTableCommand . '\': ' . $e->getMessage() . PHP_EOL; } } // Executar comandos de criação de tabela foreach ($createTableCommands as $command) { - echo "Executing: $command\n"; // Imprimir o comando SQL try { if (!$global['mysqli']->query($command)) { throw new Exception($global['mysqli']->error); } } catch (Exception $e) { - echo ('sqlDAL::executeFile ' . $filename . ' Error performing query \'' . $command . '\': ' . $e->getMessage() . '

'); + echo 'sqlDAL::executeFile ' . $filename . ' Error performing query \'' . $command . '\': ' . $e->getMessage() . PHP_EOL; } } // Adicionar LOCK TABLES para todas as tabelas identificadas if (!empty($tables)) { $lockTables = 'LOCK TABLES ' . implode(' WRITE, ', $tables) . ' WRITE;'; - echo "Executing: $lockTables\n"; // Imprimir o comando SQL try { if (!$global['mysqli']->query($lockTables)) { throw new Exception($global['mysqli']->error); } } catch (Exception $e) { - echo ('sqlDAL::executeFile ' . $filename . ' Error performing query \'' . $lockTables . '\': ' . $e->getMessage() . '

'); + echo 'sqlDAL::executeFile ' . $filename . ' Error performing query \'' . $lockTables . '\': ' . $e->getMessage() . PHP_EOL; return; } } @@ -139,13 +136,12 @@ function executeFile($filename) { // Executar todos os outros comandos SQL foreach ($commands as $command) { if (!in_array($command, $createTableCommands)) { - echo "Executing: $command\n"; // Imprimir o comando SQL try { if (!$global['mysqli']->query($command)) { throw new Exception($global['mysqli']->error); } } catch (Exception $e) { - echo ('sqlDAL::executeFile ' . $filename . ' Error performing query \'' . $command . '\': ' . $e->getMessage() . '

'); + echo 'sqlDAL::executeFile ' . $filename . ' Error performing query \'' . $command . '\': ' . $e->getMessage() . PHP_EOL; } } } @@ -154,6 +150,6 @@ function executeFile($filename) { try { $global['mysqli']->query('UNLOCK TABLES;'); } catch (Exception $e) { - echo ('sqlDAL::executeFile ' . $filename . ' Error performing query \'UNLOCK TABLES\': ' . $e->getMessage() . '

'); + echo 'sqlDAL::executeFile ' . $filename . ' Error performing query \'UNLOCK TABLES\': ' . $e->getMessage() . PHP_EOL; } }