diff options
author | Andrew Dolgov <[email protected]> | 2013-04-19 13:42:40 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2013-04-19 13:42:40 +0400 |
commit | 68cccafcad6b59eb9088793f5d3a506de03aab6b (patch) | |
tree | 5421a9da09d031310cff7f7d76df690798cb2f5a /include/functions.php | |
parent | 9ec103525da078d46fc2cf0a5ed34a690385120c (diff) |
remove debug_enabled global
Diffstat (limited to 'include/functions.php')
-rw-r--r-- | include/functions.php | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/include/functions.php b/include/functions.php index 004f4db2f..88484cadd 100644 --- a/include/functions.php +++ b/include/functions.php @@ -129,26 +129,20 @@ $utc_tz = new DateTimeZone('UTC'); $schema_version = false; - global $_debug_enabled; - $_debug_enabled = true; - /** * Print a timestamped debug message. * * @param string $msg The debug message. * @return void */ - function _debug($msg) { - global $_debug_enabled; - - if (!$_debug_enabled) return; + function _debug($msg, $show = true) { $ts = strftime("%H:%M:%S", time()); if (function_exists('posix_getpid')) { $ts = "$ts/" . posix_getpid(); } - if (!(defined('QUIET') && QUIET)) { + if ($show && !(defined('QUIET') && QUIET)) { print "[$ts] $msg\n"; } @@ -163,15 +157,6 @@ } // function _debug - function _debug_enable($enabled) { - global $_debug_enabled; - - $old = $_debug_enabled; - $_debug_enabled = $enabled; - - return $old; - } - /** * Purge a feed old posts. * |