]> git.wh0rd.org - tt-rss.git/blob - classes/logger/sql.php
Merge branch 'master' of git.tt-rss.org:git/tt-rss into pdo-experimental
[tt-rss.git] / classes / logger / sql.php
1 <?php
2 class Logger_SQL {
3
4 function log_error($errno, $errstr, $file, $line, $context) {
5
6 $pdo = Db::pdo();
7
8 if ($pdo && get_schema_version() > 117) {
9
10 try {
11 $pdo->rollBack();
12 } catch (Exception $e) {
13 //
14 }
15
16 $owner_uid = $_SESSION["uid"] ? $_SESSION["uid"] : null;
17
18 $sth = $pdo->prepare("INSERT INTO ttrss_error_log
19 (errno, errstr, filename, lineno, context, owner_uid, created_at) VALUES
20 (?, ?, ?, ?, ?, ?, NOW())");
21 $sth->execute([$errno, $errstr, $file, $line, $context, $owner_uid]);
22
23 return $sth->rowCount();
24 }
25
26 return false;
27 }
28
29 }