diff options
author | Andrew Dolgov <[email protected]> | 2005-12-22 13:51:12 +0100 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2005-12-22 13:51:12 +0100 |
commit | 6043fb7e201b85e6677680f33660d53abfac1756 (patch) | |
tree | 22c9e48a8b24def8dbc06c035668a993434b7eeb /functions.php | |
parent | 59b7764387a7e47ad4526ebdcf71a3cf2da75a2d (diff) |
proper handling of failed sanity check in parse_counters + weird getAttribute workaround
Diffstat (limited to 'functions.php')
-rw-r--r-- | functions.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/functions.php b/functions.php index 80fed8e3b..d34e133ae 100644 --- a/functions.php +++ b/functions.php @@ -859,4 +859,24 @@ else return "even"; } + + function sanity_check($link) { + + $error_code = 0; + $result = db_query($link, "SELECT schema_version FROM ttrss_version"); + $schema_version = db_fetch_result($result, 0, "schema_version"); + + if ($schema_version != SCHEMA_VERSION) { + $error_code = 5; + } + + print "<error error-code='$error_code'/>"; + + if ($error_code != 0) { + return false; + } else { + return true; + } + } + ?> |