diff options
author | Andrew Dolgov <[email protected]> | 2019-03-07 06:54:05 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2019-03-07 06:54:05 +0300 |
commit | a1f832287199b67fb7784ec8483f962d9ed4966b (patch) | |
tree | bbe0b5ae791f4b56232e057cc7573f0364ef43a7 /classes/dbupdater.php | |
parent | 44858ca2dd677e0ede51c7a326eeb0d598bdcf1b (diff) |
further update CLI schema updater layout to make it more readable
Diffstat (limited to 'classes/dbupdater.php')
-rw-r--r-- | classes/dbupdater.php | 14 |
1 files changed, 7 insertions, 7 deletions
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 "<pre>$line</pre>"; - else - print " * $line\n"; + if ($html_output) + print "<pre>$line</pre>"; + 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 "<div class='text-error'>Error: " . implode(", ", $this->pdo->errorInfo()) . "</div>"; + print "<div class='text-error'>Error: " . $e->getMessage() . "</div>"; } else { - Debug::log("Error: " . implode(", ", $this->pdo->errorInfo())); + Debug::log("Error: " . $e->getMessage()); } $this->pdo->rollBack(); |