Index: trunk/globals.php =================================================================== diff -u -N -r3201 -r3216 --- trunk/globals.php (.../globals.php) (revision 3201) +++ trunk/globals.php (.../globals.php) (revision 3216) @@ -1743,9 +1743,11 @@ * * @return bool */ -function IsDebugMode() +function IsDebugMode($check_debugger = true) { - return defined('DEBUG_MODE') && constant('DEBUG_MODE') == 1 ? 1 : 0; + $debug_mode = defined('DEBUG_MODE') && DEBUG_MODE; + if($check_debugger) $debug_mode = $debug_mode && isset($GLOBALS['debugger']); + return $debug_mode; } /** @@ -2032,5 +2034,19 @@ } return $ret; } + + if( !function_exists('constOn') ) + { + /** + * Checks if constant is defined and has positive value + * + * @param string $const_name + * @return bool + */ + function constOn($const_name) + { + return defined($const_name) && constant($const_name); + } + } ?>