]> git.wh0rd.org Git - tt-rss.git/commitdiff
replace suppress debugging kludge with a more flexible function (fixes
authorAndrew Dolgov <fox@fakecake.org>
Sun, 15 Sep 2013 18:57:50 +0000 (22:57 +0400)
committerAndrew Dolgov <fox@fakecake.org>
Sun, 15 Sep 2013 19:02:21 +0000 (23:02 +0400)
logging with update.php --feeds being stopped after first feed)

include/functions.php
include/rssfuncs.php

index 4917bca2e226ca41313b3a3ead958ca441914e37..2f16ea58e74eb23c75bcca6a90c5b9d1b1fb914a 100644 (file)
@@ -11,6 +11,7 @@
        $fetch_last_error_code = false;
        $fetch_last_content_type = false;
        $fetch_curl_used = false;
+       $suppress_debugging = false;
 
        mb_internal_encoding("UTF-8");
        date_default_timezone_set('UTC');
 
        $schema_version = false;
 
+       function _debug_suppress($suppress) {
+               global $suppress_debugging;
+
+               $suppress_debugging = $suppress;
+       }
+
        /**
         * Print a timestamped debug message.
         *
         * @return void
         */
        function _debug($msg, $show = true) {
-               if (defined('SUPPRESS_DEBUGGING'))
-                       return false;
+               global $suppress_debugging;
+
+               //echo "[$suppress_debugging] $msg $show\n";
+
+               if ($suppress_debugging) return false;
 
                $ts = strftime("%H:%M:%S", time());
                if (function_exists('posix_getpid')) {
index 7f6417759e1a8b7f310414f186d893618275c85e..c8aa7dc23786c0ed368be73b4a68314a761f0ee3 100644 (file)
                                while ($tline = db_fetch_assoc($tmp_result)) {
                                        if($debug) _debug(" => " . $tline["last_updated"] . ", " . $tline["id"] . " " . $tline["owner_uid"]);
                                        update_rss_feed($tline["id"], true);
+                                       _debug_suppress(false);
                                        ++$nf;
                                }
                        }
 
                $debug_enabled = defined('DAEMON_EXTENDED_DEBUG') || $_REQUEST['xdebug'];
 
-               if (!$debug_enabled) define('SUPPRESS_DEBUGGING', true);
-
+               _debug_suppress(!$debug_enabled);
                _debug("start", $debug_enabled);
 
                $result = db_query("SELECT id,update_interval,auth_login,