//кидаешь в \php_interface\include\pixelplus //а потом в init.php //require_once dirname(__FILE__)."/include/pixelplus/dump.php"; function bug($var){ $a=func_get_args(); call_user_func_array(array(FirePHP::getInstance(true),"log"),$a); //fb($var, FirePHP::LOG); } function dump(){ global $QS_DEBUG_CNT; //$useDiv = true,$hidden=false $useDiv = true; $hidden = false; $args = func_get_args(); if (in_array($args[count($args)-1][0],array('h','t','f'))) { $type = $args[count($args)-1]; unset ($args[count($args)-1]); } else { $type = 'n'; } $file = substr($type,2); if (!$file) $file = 'dump.txt'; $type = $type[0]; $x = debug_backtrace(); $x = $x[0]; $x['file'] = substr($x['file'],strlen($_SERVER['DOCUMENT_ROOT'])); switch ($type) { case 'h': $hidden=true; break; case 't': $useDiv=false; break; case 'f': $res = ''; foreach ($args as $value) $res .= print_r($value,true)."\n\n=================================================================\n\n"; $f = $_SERVER['DOCUMENT_ROOT'].'/'.$file; $fo = fopen($f, 'a'); fwrite($fo, $x['file']." :".$x['line']."\n\n=================================================================\n\n".$res); fclose($fo); return; } if (!defined("QS_DUMP_STARTED")) $QS_DEBUG_CNT = 0; echo "
"; if (!$useDiv){ echo ""; } else { if (!defined("QS_DUMP_STARTED")){ define("QS_DUMP_STARTED", true); if (!$hidden) echo "