1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 18:35:57 +00:00

drop errors.php and simplify error handling

This commit is contained in:
Andrew Dolgov
2021-02-23 22:26:07 +03:00
parent 37d46411c7
commit 8d2e3c2528
19 changed files with 94 additions and 200 deletions

View File

@@ -323,20 +323,6 @@
}
}
function sanity_check() {
require_once 'errors.php';
$ERRORS = get_error_types();
$error_code = 0;
$schema_version = get_schema_version(true);
if ($schema_version != SCHEMA_VERSION) {
$error_code = 5;
}
return array("code" => $error_code, "message" => $ERRORS[$error_code]);
}
function file_is_locked($filename) {
if (file_exists(Config::get(Config::LOCK_DIRECTORY) . "/$filename")) {
if (function_exists('flock')) {
@@ -533,20 +519,6 @@
return file_exists("themes/$theme") || file_exists("themes.local/$theme");
}
/**
* @SuppressWarnings(unused)
*/
function error_json($code) {
require_once "errors.php";
$ERRORS = get_error_types();
@$message = $ERRORS[$code];
return json_encode(array("error" =>
array("code" => $code, "message" => $message)));
}
function arr_qmarks($arr) {
return str_repeat('?,', count($arr) - 1) . '?';
}