diff options
Diffstat (limited to 'backend.php')
-rw-r--r-- | backend.php | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/backend.php b/backend.php index 77812b981..2ed2f9266 100644 --- a/backend.php +++ b/backend.php @@ -1,5 +1,5 @@ <? - define(SCHEMA_VERSION, 1); + define(SCHEMA_VERSION, 2); $op = $_GET["op"]; @@ -28,6 +28,7 @@ pg_query("set client_encoding = 'utf-8'"); } +/* $result = db_query($link, "SELECT schema_version FROM ttrss_version"); $schema_version = db_fetch_result($result, 0, "schema_version"); @@ -37,7 +38,8 @@ (got version $schema_version; expected ".SCHEMA_VERSION.")"; return; } - +*/ + $fetch = $_GET["fetch"]; /* FIXME this needs reworking */ @@ -360,6 +362,21 @@ print "Marked active page as read."; } + + if ($subop == "sanityCheck") { + + $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 code='$error_code'/>"; + } } if ($op == "feeds") { |