--- htrace.php-orig 2007-08-15 16:00:08.000000000 +0900 +++ htrace.php 2007-08-24 16:14:19.695454000 +0900 @@ -18,25 +18,35 @@ * @version 0.1.0 * @since File available since Release 0.1.0 */ -function htrace($vars, $stop=false) -{ - $trace = debug_backtrace(); - $debug = array_shift($trace); - $exp = explode('\\', $debug['file']); - $key = ''; - foreach ($exp as $num=>$dt) { - $key .= rawurlencode($dt).'/'; - } - $key .= sprintf("%05d", $debug['line']); - $inc = new HTTPTraceClient(); - $inc->ModeGlobal(); - $inc->SendValue($key, $vars, $stop); + +if (!defined('USE_HTRACE')) { + define('USE_HTRACE', true); } -function htrace_set($ip='localhost', $port=6006) -{ - $inc = new HTTPTraceClient(); - $inc->ModeGlobal(array('ip'=>$ip, 'port'=>$port)); +if (USE_HTRACE) { + function htrace($vars, $stop=false) + { + $trace = debug_backtrace(); + $debug = array_shift($trace); + $exp = explode(DIRECTORY_SEPARATOR, $debug['file']); + $key = ''; + foreach ($exp as $num=>$dt) { + $key .= rawurlencode($dt).'/'; + } + $key .= sprintf("%05d", $debug['line']); + $inc = new HTTPTraceClient(); + $inc->ModeGlobal(); + $inc->SendValue($key, $vars, $stop); + } + + function htrace_set($ip='localhost', $port=6006) + { + $inc = new HTTPTraceClient(); + $inc->ModeGlobal(array('ip'=>$ip, 'port'=>$port)); + } +} else { + function htrace() {} + function htrace_set() {} } class HTTPTraceClient { @@ -271,7 +281,7 @@ } // Open the connection - $fp = fsockopen($host, $port, &$err_num, &$err_msg, 1); + $fp = @fsockopen($host, $port, $err_num, $err_msg, 1); // No Connection Error if(!$fp){