summaryrefslogtreecommitdiff
path: root/include/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-09-15 22:57:50 +0400
committerAndrew Dolgov <[email protected]>2013-09-15 23:02:21 +0400
commit4f71d7431c90c5b85ae316b348a176fed368d8d7 (patch)
tree05dafd0ae80174c09ba30b3fbdae0fd4de2625c7 /include/functions.php
parent811a81c6ded139d38512e6f7e4e012fa63816b75 (diff)
replace suppress debugging kludge with a more flexible function (fixes
logging with update.php --feeds being stopped after first feed)
Diffstat (limited to 'include/functions.php')
-rw-r--r--include/functions.php14
1 files changed, 12 insertions, 2 deletions
diff --git a/include/functions.php b/include/functions.php
index 4917bca2e..2f16ea58e 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')) {