]>
git.wh0rd.org - tt-rss.git/blob - classes/logger/sql.php
4 function log_error($errno, $errstr, $file, $line, $context) {
5 if (Db
::get() && get_schema_version() > 117) {
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 = ''; // backtrace is a lot of data which is not really critical to store
12 //$context = $this->dbh->escape_string(serialize($context));
14 $owner_uid = $_SESSION["uid"] ?
$_SESSION["uid"] : "NULL";
16 $result = Db
::get()->query(
17 "INSERT INTO ttrss_error_log
18 (errno, errstr, filename, lineno, context, owner_uid, created_at) VALUES
19 ($errno, '$errstr', '$file', '$line', '$context', $owner_uid, NOW())");
21 return Db
::get()->affected_rows($result) != 0;