summaryrefslogtreecommitdiff
path: root/backend.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2005-11-16 08:59:46 +0100
committerAndrew Dolgov <[email protected]>2005-11-16 08:59:46 +0100
commit295f9b422a7fdecc451f31ab16f585582d888222 (patch)
tree9c8f457b205a598acdb89f3aac8aae04b708f1c3 /backend.php
parent1089b16bc2dccbfba226fbd7d98b7535203449d2 (diff)
perform backend sanity check on startup, update schema version in backend.php
Diffstat (limited to 'backend.php')
-rw-r--r--backend.php21
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") {