From a1f832287199b67fb7784ec8483f962d9ed4966b Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 7 Mar 2019 06:54:05 +0300 Subject: further update CLI schema updater layout to make it more readable --- classes/dbupdater.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'classes') diff --git a/classes/dbupdater.php b/classes/dbupdater.php index 70cea881b..94307aea0 100644 --- a/classes/dbupdater.php +++ b/classes/dbupdater.php @@ -41,20 +41,20 @@ class DbUpdater { $this->pdo->beginTransaction(); foreach ($lines as $line) { + if (strpos($line, "--") !== 0 && $line) { - if ($html_output) - print "
$line
"; - else - print " * $line\n"; + if ($html_output) + print "
$line
"; + else + Debug::log("> $line"); - if (strpos($line, "--") !== 0 && $line) { try { $this->pdo->query($line); // PDO returns errors as exceptions now } catch (PDOException $e) { if ($html_output) { - print "
Error: " . implode(", ", $this->pdo->errorInfo()) . "
"; + print "
Error: " . $e->getMessage() . "
"; } else { - Debug::log("Error: " . implode(", ", $this->pdo->errorInfo())); + Debug::log("Error: " . $e->getMessage()); } $this->pdo->rollBack(); -- cgit v1.2.3