diff options
Diffstat (limited to 'classes')
-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(); |