Index: trunk/core/kernel/utility/debugger.php =================================================================== diff -u -N -r4819 -r4821 --- trunk/core/kernel/utility/debugger.php (.../debugger.php) (revision 4819) +++ trunk/core/kernel/utility/debugger.php (.../debugger.php) (revision 4821) @@ -96,10 +96,32 @@ var $reportDone = false; var $dummyImage = ''; - + + /** + * Folder for holding AJAX temporary file + * + * @var string + */ + var $tempFolder = ''; + + /** + * Debug rows will be separated using this string before writing to debug file + * + * @var string + */ + var $rowSeparator = '@@'; + + /** + * Base URL for debugger includes + * + * @var string + */ + var $baseURL = ''; + function Debugger() { $this->dummyImage = PROTOCOL.SERVER_NAME.(defined('PORT')?':'.PORT : '').rtrim(BASE_PATH, '/').'/'.'kernel/admin_templates/img/spacer.gif'; + $this->tempFolder = FULL_PATH.'/kernel/cache'; global $start; $this->profileStart('kernel4_startup', 'Startup and Initialization of kernel4', $start); @@ -112,6 +134,18 @@ $this->appendRequest(); } + function InitReport() + { + if (!class_exists('kApplication')) return false; + + $application =& kApplication::Instance(); + $this->rowSeparator = '@'.$application->GetSID().'@'; + + $reg_exp = '/^'.preg_quote(FULL_PATH, '/').'/'; + $kernel_path = preg_replace($reg_exp, '', KERNEL_PATH, 1); + $this->baseURL = PROTOCOL.SERVER_NAME.rtrim(BASE_PATH, '/').$kernel_path.'/utility/debugger'; + } + function mapLongError($msg) { $key = $this->generateID(); @@ -572,7 +606,7 @@ break; } } - + /** * Generates report * @@ -588,6 +622,9 @@ if (defined('SPACER_URL')) { $this->dummyImage = SPACER_URL; } + + $this->InitReport(); + dbg_safeDefine('DBG_RAISE_ON_WARNINGS', 0); $this->memoryUsage['debugger_start'] = memory_get_usage(); @@ -610,7 +647,7 @@ if (dbg_ConstOn('DBG_PROFILE_MEMORY')) { $this->appendHTML('Memory used by Objects: '.round($this->ProfilerTotals['objects']/1024, 2).'Kb'); } - + /*if( dbg_ConstOn('DBG_INCLUDED_FILES') ) { $files = get_included_files(); @@ -647,268 +684,40 @@ } }*/ + + $i = 0; + $lineCount = count($this->Data); + + $debug_file = $this->tempFolder.'/debug_'.$this->rowSeparator.'.txt'; + if (file_exists($debug_file)) unlink($debug_file); + + $fp = fopen($debug_file, 'a'); + while ($i < $lineCount) { + fwrite($fp, $this->prepareHTML($i).$this->rowSeparator); + $i++; + } + fclose($fp); + + ob_start(); - ?> - - -