diff options
author | Filipp Lepalaan <filipp@mekanisti.fi> | 2009-10-26 22:57:07 +0200 |
---|---|---|
committer | Filipp Lepalaan <filipp@mekanisti.fi> | 2009-10-26 22:57:07 +0200 |
commit | 730f91b3bab0767563184f99b40a851b6af6b635 (patch) | |
tree | 448f6ce52cfc39046773ebdd1a4f05cb39db1a17 /App.php | |
parent | c217e77f2540085922b4483c99670eca06923799 (diff) | |
parent | b69995e1d0bcd5ea1185acfda4899e11f1d8e624 (diff) | |
download | main-730f91b3bab0767563184f99b40a851b6af6b635.tar.gz main-730f91b3bab0767563184f99b40a851b6af6b635.tar.bz2 main-730f91b3bab0767563184f99b40a851b6af6b635.zip |
Merge branch 'master' of github.com:filipp/main
Conflicts:
Db.php
Diffstat (limited to 'App.php')
-rw-r--r-- | App.php | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -102,7 +102,9 @@ class App static function error($msg) { $err = array('result' => 'error', 'msg' => $msg); + // Send error to client self::json($msg); + // And log it locally self::log($msg); } @@ -124,7 +126,13 @@ class App } $c = self::conf("app.error_log"); + + if (!$c) { + return false; + } + $file = realpath(__FILE__."/../../../../data/$c"); + if (!$file) { return false; } @@ -133,7 +141,10 @@ class App fwrite($fh, trim($msg) . "\n"); fclose($fh); } - + + /** + * Set our own PHP error handler + */ static function error_handler($errno, $errstr, $errfile, $errline) { $str = sprintf("%s\t%s\t%s\t%s\n", date("d.m H:i:s"), basename($errfile), $errline, $errstr); |