From: Andrew Dolgov Date: Sun, 15 Sep 2013 18:57:50 +0000 (+0400) Subject: replace suppress debugging kludge with a more flexible function (fixes X-Git-Tag: 1.10~5 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=4f71d7431c90c5b85ae316b348a176fed368d8d7;p=tt-rss.git replace suppress debugging kludge with a more flexible function (fixes logging with update.php --feeds being stopped after first feed) --- diff --git a/include/functions.php b/include/functions.php index 4917bca2..2f16ea58 100644 --- a/include/functions.php +++ b/include/functions.php @@ -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'); @@ -132,6 +133,12 @@ $schema_version = false; + function _debug_suppress($suppress) { + global $suppress_debugging; + + $suppress_debugging = $suppress; + } + /** * Print a timestamped debug message. * @@ -139,8 +146,11 @@ * @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')) { diff --git a/include/rssfuncs.php b/include/rssfuncs.php index 7f641775..c8aa7dc2 100644 --- a/include/rssfuncs.php +++ b/include/rssfuncs.php @@ -175,6 +175,7 @@ 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; } } @@ -194,8 +195,7 @@ $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,