Index: branches/unlabeled/unlabeled-1.155.2/core/kernel/application.php =================================================================== diff -u -r5762 -r5763 --- branches/unlabeled/unlabeled-1.155.2/core/kernel/application.php (.../application.php) (revision 5762) +++ branches/unlabeled/unlabeled-1.155.2/core/kernel/application.php (.../application.php) (revision 5763) @@ -236,14 +236,6 @@ $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); - $level = $this->ConfigValue('OutputCompressionLevel'); - if ($level < 0 || $level > 9) $level = 7; - safeDefine('DBG_COMPRESSION_LEVEL', $level); - } - $this->HttpQuery =& $this->recallObject('HTTPQuery'); $this->Session =& $this->recallObject('Session'); @@ -694,13 +686,26 @@ } //eval("?".">".$this->HTML); - - $this->HTML = ob_get_clean().$this->HTML; + if ($this->isDebugMode()) { - $this->HTML .= $this->Debugger->printReport(true); + $this->EventManager->RunRegularEvents(reAFTER); + $this->Session->SaveData(); + + $this->HTML = ob_get_clean() . $this->HTML . $this->Debugger->printReport(true); } + else { + $this->HTML = ob_get_clean().$this->HTML; + } - echo $this->UseOutputCompression() ? gzencode($this->HTML, DBG_COMPRESSION_LEVEL) : $this->HTML; + if ($this->UseOutputCompression()) { + header('Content-Encoding: gzip'); + $compression_level = $this->ConfigValue('OutputCompressionLevel'); + if ($compression_level < 0 || $compression_level > 9) $compression_level = 7; + echo gzencode($this->HTML, $compression_level); + } + else { + echo $this->HTML; + } $this->UpdateCache(); @@ -726,15 +731,6 @@ return $this->ConfigValue('UseOutputCompression') && function_exists('gzencode') && strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip'); } - function SaveBlocksCache() - { - /*if (constOn('EXPERIMENTAL_PRE_PARSE')) { - $data = serialize($this->PreParsedCache); - - $this->Conn->Query('REPLACE '.TABLE_PREFIX.'Cache (VarName, Data, Cached) VALUES ("blocks_cache", '.$this->Conn->qstr($data).', '.adodb_mktime().')'); - }*/ - } - // Facade /** @@ -1444,13 +1440,9 @@ } } } - - $buffer_content = ob_get_clean(); - echo $this->UseOutputCompression() ? gzencode($buffer_content, DBG_COMPRESSION_LEVEL) : $buffer_content; - - $session =& $this->recallObject('Session'); - $session->SaveData(); - $this->SaveBlocksCache(); + + ob_end_flush(); + $this->Session->SaveData(); exit; }