X-Git-Url: https://git.wh0rd.org/?p=tt-rss.git;a=blobdiff_plain;f=classes%2Flogger%2Fsql.php;h=73552c143528d68066203148bc843f34f1e2481c;hp=120584014ce3be33e28eb3adc647528e55b89c7e;hb=bb84330234c649fb0a8726e488fca012f5295ce4;hpb=80fd79ca304d53d94f4b4f341ad61436976a2e7e diff --git a/classes/logger/sql.php b/classes/logger/sql.php old mode 100644 new mode 100755 index 12058401..73552c14 --- a/classes/logger/sql.php +++ b/classes/logger/sql.php @@ -1,21 +1,18 @@ 117) { - try { - $pdo->rollBack(); - } catch (Exception $e) { - // - } + // separate PDO connection object is used for logging + if (!$this->pdo) $this->pdo = Db::instance()->pdo_connect(); + + if ($this->pdo && get_schema_version() > 117) { $owner_uid = $_SESSION["uid"] ? $_SESSION["uid"] : null; - $sth = $pdo->prepare("INSERT INTO ttrss_error_log + $sth = $this->pdo->prepare("INSERT INTO ttrss_error_log (errno, errstr, filename, lineno, context, owner_uid, created_at) VALUES (?, ?, ?, ?, ?, ?, NOW())"); $sth->execute([$errno, $errstr, $file, $line, $context, $owner_uid]); @@ -26,4 +23,4 @@ class Logger_SQL { return false; } -} \ No newline at end of file +}