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