summaryrefslogtreecommitdiff
path: root/include/functions.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/functions.php')
-rw-r--r--include/functions.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/functions.php b/include/functions.php
index 8ac5753c9..004f4db2f 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -129,6 +129,9 @@
$utc_tz = new DateTimeZone('UTC');
$schema_version = false;
+ global $_debug_enabled;
+ $_debug_enabled = true;
+
/**
* Print a timestamped debug message.
*
@@ -136,6 +139,10 @@
* @return void
*/
function _debug($msg) {
+ global $_debug_enabled;
+
+ if (!$_debug_enabled) return;
+
$ts = strftime("%H:%M:%S", time());
if (function_exists('posix_getpid')) {
$ts = "$ts/" . posix_getpid();
@@ -156,6 +163,15 @@
} // function _debug
+ function _debug_enable($enabled) {
+ global $_debug_enabled;
+
+ $old = $_debug_enabled;
+ $_debug_enabled = $enabled;
+
+ return $old;
+ }
+
/**
* Purge a feed old posts.
*