diff --git a/log/error_handler/error_handler.php b/log/error_handler/error_handler.php index 093707c..70e03ea 100644 --- a/log/error_handler/error_handler.php +++ b/log/error_handler/error_handler.php @@ -1,12 +1,26 @@ logged){ return false;} //alrdy logged(this prevents proper thrown value for every system exception) - $result = \SYSTEM\SQL\SYS_LOG_INSERT::QI( /*array( get_class($E), $E->getMessage(), $E->getCode(), $E->getFile(), $E->getLine(), $E->getTraceAsString(), - getenv('REMOTE_ADDR'),round(microtime(true) - \SYSTEM\time::getStartTime(),5), - $_SERVER["SERVER_NAME"],$_SERVER["SERVER_PORT"],$_SERVER['REQUEST_URI'], serialize($_POST), - array_key_exists('HTTP_REFERER', $_SERVER) ? $_SERVER['HTTP_REFERER'] : null, - array_key_exists('HTTP_USER_AGENT',$_SERVER) ? $_SERVER['HTTP_USER_AGENT'] : null, - ($user = \SYSTEM\SECURITY\security::getUser()) ? $user->id : null, $thrown ? 1 : 0),*/ - array( get_class($E), $E->getMessage(), $E->getCode(), $E->getFile(), $E->getLine(), $E->getTraceAsString(), + $result = \SYSTEM\SQL\SYS_LOG_INSERT::QI(array( + get_class($E), $E->getMessage(), $E->getCode(), $E->getFile(), $E->getLine(), $E->getTraceAsString(), getenv('REMOTE_ADDR'),round(microtime(true) - \SYSTEM\time::getStartTime(),5), $_SERVER["SERVER_NAME"],$_SERVER["SERVER_PORT"],$_SERVER['REQUEST_URI'], serialize($_POST), array_key_exists('HTTP_REFERER', $_SERVER) ? $_SERVER['HTTP_REFERER'] : null, diff --git a/log/error_handler/error_handler_jsonoutput.php b/log/error_handler/error_handler_jsonoutput.php index 2058311..98f236e 100644 --- a/log/error_handler/error_handler_jsonoutput.php +++ b/log/error_handler/error_handler_jsonoutput.php @@ -1,15 +1,34 @@ Ignore - return die(); //die is required cuz else some fatals cant be catched properly + return true; } } } \ No newline at end of file diff --git a/log/exceptions/COUNTER.php b/log/exceptions/COUNTER.php index 26dcfbd..cb50e33 100644 --- a/log/exceptions/COUNTER.php +++ b/log/exceptions/COUNTER.php @@ -1,5 +1,17 @@ 0, 'status' => false, 'result' => $error); @@ -48,5 +101,4 @@ class log { return json_encode($result);} return $bufferContent; } -} - +} \ No newline at end of file diff --git a/log/qq/SYS_LOG_DEL.php b/log/qq/SYS_LOG_DEL.php index 10ec961..657cbbc 100644 --- a/log/qq/SYS_LOG_DEL.php +++ b/log/qq/SYS_LOG_DEL.php @@ -1,5 +1,19 @@ getMessage(); $error['code'] = $e->getCode(); $error['file'] = $e->getFile(); $error['line'] = $e->getLine(); - $error['trace'] = array_slice(explode('#', $e->getTraceAsString()), 1, -1); - - return self::toString($error, self::JSONRESULT_ERROR); + $error['trace'] = array_slice(explode('#', $e->getTraceAsString()), 1, -1); + return self::toString($error, false); } - //Returns OK status + /** + * Retun JsonResult with success status + * + * @return string Returns json string. + */ public static function ok(){ return self::toString(NULL);} + + /** + * Retun JsonResult with failure status + * + * @return string Returns json string. + */ public static function fail(){ - return self::toString(NULL,self::JSONRESULT_ERROR);} + return self::toString(NULL,false);} } \ No newline at end of file diff --git a/log/result_shortcut/JsonResult.php b/log/result_shortcut/JsonResult.php index 30dabf6..aa65783 100644 --- a/log/result_shortcut/JsonResult.php +++ b/log/result_shortcut/JsonResult.php @@ -1,3 +1,16 @@