]> git.wh0rd.org - tt-rss.git/blame - classes/logger/sql.php
sql logger: pdo
[tt-rss.git] / classes / logger / sql.php
CommitLineData
889a5f9f
AD
1<?php
2class Logger_SQL {
3
889a5f9f 4 function log_error($errno, $errstr, $file, $line, $context) {
4102eb84
AD
5
6 $pdo = Db::pdo();
7
8 if ($pdo && get_schema_version() > 117) {
aca75cb5 9
4102eb84 10 $owner_uid = $_SESSION["uid"] ? $_SESSION["uid"] : null;
889a5f9f 11
4102eb84 12 $sth = $pdo->prepare("INSERT INTO ttrss_error_log
889a5f9f 13 (errno, errstr, filename, lineno, context, owner_uid, created_at) VALUES
4102eb84
AD
14 (?, ?, ?, ?, ?, ?, NOW())");
15 $sth->execute([$errno, $errstr, $file, $line, $context, $owner_uid]);
889a5f9f 16
4102eb84 17 return $sth->rowCount();
889a5f9f 18 }
aca75cb5 19
889a5f9f
AD
20 return false;
21 }
22
ea79a0e0 23}