]>
Commit | Line | Data |
---|---|---|
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 | $owner_uid = $_SESSION["uid"] ? $_SESSION["uid"] : null; | |
11 | ||
12 | $sth = $pdo->prepare("INSERT INTO ttrss_error_log | |
13 | (errno, errstr, filename, lineno, context, owner_uid, created_at) VALUES | |
14 | (?, ?, ?, ?, ?, ?, NOW())"); | |
15 | $sth->execute([$errno, $errstr, $file, $line, $context, $owner_uid]); | |
16 | ||
17 | return $sth->rowCount(); | |
18 | } | |
19 | ||
20 | return false; | |
21 | } | |
22 | ||
23 | } |