From 68cccafcad6b59eb9088793f5d3a506de03aab6b Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 19 Apr 2013 13:42:40 +0400 Subject: remove debug_enabled global --- include/functions.php | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'include/functions.php') 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. * -- cgit v1.2.3