1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 07:25:54 +00:00

further update CLI schema updater layout to make it more readable

This commit is contained in:
Andrew Dolgov
2019-03-07 06:54:05 +03:00
parent 44858ca2dd
commit a1f8322871
2 changed files with 17 additions and 16 deletions

View File

@@ -41,20 +41,20 @@ class DbUpdater {
$this->pdo->beginTransaction();
foreach ($lines as $line) {
if ($html_output)
print "<pre>$line</pre>";
else
print " * $line\n";
if (strpos($line, "--") !== 0 && $line) {
if ($html_output)
print "<pre>$line</pre>";
else
Debug::log("> $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();