]> git.wh0rd.org Git - tt-rss.git/commitdiff
add schema checking to feed updating and update script
authorAndrew Dolgov <fox@fakecake.org>
Wed, 17 Apr 2013 08:10:35 +0000 (12:10 +0400)
committerAndrew Dolgov <fox@fakecake.org>
Wed, 17 Apr 2013 08:10:35 +0000 (12:10 +0400)
include/rssfuncs.php
update.php
update_daemon2.php

index 0a20f5d8ea4438b7caf1f6ab4bf4ad46a0ad0060..9ea2662fccd0ea07cef1b0e3f6a3344469dc0f02 100644 (file)
        function update_daemon_common($link, $limit = DAEMON_FEED_LIMIT, $from_http = false, $debug = true) {
                // Process all other feeds using last_updated and interval parameters
 
+               $schema_version = get_schema_version($link);
+
+               if ($schema_version != SCHEMA_VERSION) {
+                       die("Schema version is wrong, please upgrade the database.\n");
+               }
+
                define('PREFS_NO_CACHE', true);
 
                // Test if the user has loggued in recently. If not, it does not update its feeds.
index f5fa9e5694f0e170c6fa4bcd7e24592eb1c73fcb..1c43cdb94c2233be9aaf3c426e117590498b33bf 100755 (executable)
                return;
        }
 
+       if (!isset($options['update-schema'])) {
+               $schema_version = get_schema_version($link);
+
+               if ($schema_version != SCHEMA_VERSION) {
+                       die("Schema version is wrong, please upgrade the database.\n");
+               }
+       }
+
        define('QUIET', isset($options['quiet']));
 
        if (isset($options["log"])) {
index 8e1917b6f6efa91ef9025447342ca5827ee4b019..77d05be66159b2556aaebbfed6ec493d044eb3f8 100755 (executable)
 
        db_close($link);
 
+       if ($schema_version != SCHEMA_VERSION) {
+               die("Schema version is wrong, please upgrade the database.\n");
+       }
+
        while (true) {
 
                // Since sleep is interupted by SIGCHLD, we need another way to