Index: branches/unlabeled/unlabeled-1.58.2/core/kernel/utility/unit_config_reader.php =================================================================== diff -u -r5446 -r5632 --- branches/unlabeled/unlabeled-1.58.2/core/kernel/utility/unit_config_reader.php (.../unit_config_reader.php) (revision 5446) +++ branches/unlabeled/unlabeled-1.58.2/core/kernel/utility/unit_config_reader.php (.../unit_config_reader.php) (revision 5632) @@ -46,7 +46,7 @@ 'User_LoggedInGroup', 'SessionTimeout', 'UseModRewrite', - 'AdminDirectory', + 'UseOutputCompression', ); foreach ($config_vars as $var) { Index: branches/unlabeled/unlabeled-1.2.2/core/kernel/utility/debugger/debugger_responce.php =================================================================== diff -u -r4846 -r5632 --- branches/unlabeled/unlabeled-1.2.2/core/kernel/utility/debugger/debugger_responce.php (.../debugger_responce.php) (revision 4846) +++ branches/unlabeled/unlabeled-1.2.2/core/kernel/utility/debugger/debugger_responce.php (.../debugger_responce.php) (revision 5632) @@ -3,13 +3,52 @@ $sid = $_GET['sid']; if (!preg_match('/^@([\d]+)@$/', $sid)) exit; - + $debug_file = FULL_PATH.'/kernel/cache/debug_'.$sid.'.txt'; if (file_exists($debug_file)) { - echo file_get_contents($debug_file); + $ret = file_get_contents($debug_file); + $ret = str_replace('#DBG_FILESIZE#', formatSize( filesize($debug_file) ), $ret); unlink($debug_file); } else { - echo 'file not found'; + $ret = 'file not found'; } + + + if (function_exists('gzencode') && strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) { + header('Content-Encoding: gzip'); + echo gzencode($ret); + } + else { + echo $ret; + } + + /** + * Formats file/memory size in nice way + * + * @param int $bytes + * @return string + * @access public + */ + function formatSize($bytes) + { + if ($bytes >= 1099511627776) { + $return = round($bytes / 1024 / 1024 / 1024 / 1024, 2); + $suffix = "TB"; + } elseif ($bytes >= 1073741824) { + $return = round($bytes / 1024 / 1024 / 1024, 2); + $suffix = "GB"; + } elseif ($bytes >= 1048576) { + $return = round($bytes / 1024 / 1024, 2); + $suffix = "MB"; + } elseif ($bytes >= 1024) { + $return = round($bytes / 1024, 2); + $suffix = "KB"; + } else { + $return = $bytes; + $suffix = "Byte"; + } + $return .= ' '.$suffix; + return $return; + } ?> \ No newline at end of file Index: branches/unlabeled/unlabeled-1.155.2/core/kernel/application.php =================================================================== diff -u -r5631 -r5632 --- branches/unlabeled/unlabeled-1.155.2/core/kernel/application.php (.../application.php) (revision 5631) +++ branches/unlabeled/unlabeled-1.155.2/core/kernel/application.php (.../application.php) (revision 5632) @@ -224,6 +224,11 @@ $admin_on = getArrayValue($_REQUEST, 'admin') || $this->IsAdmin(); define('MOD_REWRITE', $rewrite_on && !$admin_on ? 1 : 0); + if ($this->UseOutputCompression()) { + header('Content-Encoding: gzip'); + safeDefine('DBG_COMPRESS_OUTPUT', 1); + } + $this->HttpQuery =& $this->recallObject('HTTPQuery'); $this->Session =& $this->recallObject('Session'); @@ -233,7 +238,7 @@ $this->LoadCache(); $this->InitConfig(); - + // Module items are recalled during url parsing & PhrasesCache is needed already there, // because it's used in their build events. That's why phrases cache initialization is // called from kHTTPQuery in case when mod_rewrite is used @@ -260,12 +265,7 @@ $this->HandleEvent( new kEvent('visits:OnRegisterVisit') ); $this->ValidateLogin(); - - if ($this->UseOutputCompression()) { - header('Content-Encoding: gzip'); - safeDefine('DBG_COMPRESS_OUTPUT', 1); - } - + if($this->isDebugMode()) { $this->Debugger->profileFinish('kernel4_startup'); } Index: branches/unlabeled/unlabeled-1.59.2/core/kernel/utility/debugger.php =================================================================== diff -u -r5629 -r5632 --- branches/unlabeled/unlabeled-1.59.2/core/kernel/utility/debugger.php (.../debugger.php) (revision 5629) +++ branches/unlabeled/unlabeled-1.59.2/core/kernel/utility/debugger.php (.../debugger.php) (revision 5632) @@ -661,7 +661,9 @@ $this->appendSession(); // show php session if any // ensure, that 1st line of debug output always is this one: - $this->appendHTML('[Reload Frame] [Hide Debugger] [Current Time: '.date('H:i:s').']'); + $top_line = '
[Reload Frame] [Hide Debugger][Current Time: '.date('H:i:s').'] [File Size: #DBG_FILESIZE#]
'; + + $this->appendHTML($top_line); $this->moveToBegin(1); if ($this->constOn('DBG_SQL_PROFILE') && isset($this->ProfilerTotals['sql'])) {