]>
Commit | Line | Data |
---|---|---|
1 | <?php | |
2 | class Logger_SQL { | |
3 | ||
4 | function log_error($errno, $errstr, $file, $line, $context) { | |
5 | if (Db::get() && get_schema_version() > 117) { | |
6 | ||
7 | $errno = Db::get()->escape_string($errno); | |
8 | $errstr = Db::get()->escape_string($errstr); | |
9 | $file = Db::get()->escape_string($file); | |
10 | $line = Db::get()->escape_string($line); | |
11 | $context = DB::get()->escape_string($context); | |
12 | ||
13 | $owner_uid = $_SESSION["uid"] ? $_SESSION["uid"] : "NULL"; | |
14 | ||
15 | $result = Db::get()->query( | |
16 | "INSERT INTO ttrss_error_log | |
17 | (errno, errstr, filename, lineno, context, owner_uid, created_at) VALUES | |
18 | ($errno, '$errstr', '$file', '$line', '$context', $owner_uid, NOW())"); | |
19 | ||
20 | return Db::get()->affected_rows($result) != 0; | |
21 | } | |
22 | ||
23 | return false; | |
24 | } | |
25 | ||
26 | } |