]> git.wh0rd.org - tt-rss.git/blobdiff - update.php
update.php & daemon: chdir to script directory using __FILE__ magic constant
[tt-rss.git] / update.php
index ac785373d34858dbf4a11086cc73460bb8ab8922..9c9c6ae8de742de18d06cd7b5c36638167e7f8f4 100755 (executable)
@@ -2,7 +2,8 @@
 <?php
        define('DISABLE_SESSIONS', true);
 
-       chdir(dirname($_SERVER['SCRIPT_NAME']));
+       chdir(dirname(__FILE__));
+
        require_once "functions.php";
        require_once "sanity_check.php";
        require_once "config.php";
        if ($op == "-feeds") {
                // Update all feeds needing a update.
                update_daemon_common($link);
+
+               // Update feedbrowser
+               $count = update_feedbrowser_cache($link);
+               _debug("Feedbrowser updated, $count feeds processed.");
+
+               // Purge orphans and cleanup tags
+               purge_orphans($link, true);
+
+               $rc = cleanup_tags($link, 14, 50000);
+               _debug("Cleaned $rc cached tags.");
        }
 
        if ($op == "-feedbrowser") {