mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2024-11-26 19:36:52 +03:00
f1fb95b257
- returnError, returnServerError, returnClientError ,debugMessage are moved to lib/error.php - getContents, getSimpleHTMLDOM, getSimpleHTMLDOMCached are moved to lib/contents.php Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
30 lines
584 B
PHP
30 lines
584 B
PHP
<?php
|
|
function returnError($message, $code){
|
|
throw new \HttpException($message, $code);
|
|
}
|
|
|
|
function returnClientError($message){
|
|
returnError($message, 400);
|
|
}
|
|
|
|
function returnServerError($message){
|
|
returnError($message, 500);
|
|
}
|
|
|
|
function debugMessage($text){
|
|
if(!file_exists('DEBUG')) {
|
|
return;
|
|
}
|
|
|
|
$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3);
|
|
$calling = $backtrace[2];
|
|
$message = $calling['file'] . ':'
|
|
. $calling['line'] . ' class '
|
|
. $calling['class'] . '->'
|
|
. $calling['function'] . ' - '
|
|
. $text;
|
|
|
|
error_log($message);
|
|
}
|
|
|
|
?>
|