#120 압축전송시 생기는 문제를 해결하지는 못하였고(재현 불가능) 일단 ob_gzhandler를 위한 모든 관련 자원에 대해 체크를 하게 하고 config/config.inc.php에서 압축전송을 켜고 끌 수 있는 설정을 마련하는 것으로 일단락.

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@2444 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2007-08-31 04:37:00 +00:00
parent 0767476eba
commit 13c9711400
2 changed files with 26 additions and 11 deletions

View file

@ -22,7 +22,12 @@
function printContent(&$oModule) {
// gzip encoding 지원 여부 체크
if(strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')!==false && function_exists('ob_gzhandler') ) $this->gz_enabled = true;
if(
(defined('__OB_GZHANDLER_ENABLE__') && __OB_GZHANDLER_ENABLE__ == 1) &&
strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')!==false &&
function_exists('ob_gzhandler') &&
extension_loaded('zlib')
) $this->gz_enabled = true;
// header 출력
$this->_printHeader();
@ -78,15 +83,14 @@
// 컨텐츠 출력
$this->display($output);
// 디버깅 데이터 출력
$this->_debugOutput();
}
/**
* @brief 최종 결과물의 출력
**/
function display($content) {
$content .= $this->_debugOutput();
$path = str_replace('index.php','',$_SERVER['SCRIPT_NAME']);
// files로 시작되는 src나 href의 값을 절대경로로 변경
@ -163,7 +167,8 @@
* tail -f ./files/_debug_message.php로 하여 console로 확인하면 편리함\n
**/
function _debugOutput() {
if(!__DEBUG__ || (__DEBUG_OUTPUT!=0 && Context::getResponseMethod()!='HTML') ) return;
if(!__DEBUG__ || Context::getResponseMethod()!='HTML' ) return;
$end = getMicroTime();
// debug string 작성 시작
@ -207,6 +212,8 @@
// 전체 실행 시간 작성
$buff .= sprintf("\tTotal elapsed time \t\t: %0.5f sec", $end-__StartTime__);
if(__DEBUG_OUTPUT__==1) return $buff;
debugPrint($buff, false);
}

View file

@ -7,6 +7,15 @@
if(!defined('__ZBXE__')) exit();
/**
* @brief 디버깅 메세지 출력
* 0 : 디버그 메세지를 생성/ 출력하지 않음
* 1 : 전체 실행 시간에 대해서만 메세지 생성/ 출력
* 2 : 1 + DB 쿼리
* 3 : 모든 로그
**/
define('__DEBUG__', 0);
/**
* @brief 디버그 메세지의 출력 장소
* 0 : files/_debug_message.php 연결하여 출력
@ -22,13 +31,12 @@
define('__DEBUG_DB_OUTPUT__', 0);
/**
* @brief 디버깅 메세지 출력
* 0 : 디버그 메세지를 생성/ 출력하지 않음
* 1 : 전체 실행 시간에 대해서만 메세지 생성/ 출력
* 2 : 1 + DB 쿼리
* 3 : 모든 로그
* @brief ob_gzhandler를 이용한 압축 기능을 강제로 사용하거나 끄는 옵션
* 0 : 사용하지 않음
* 1 : 사용함
* 대부분의 서버에서는 문제가 없는데 특정 서버군에서 압축전송시 IE에서 오동작을 일으키는경우가 있음
**/
define('__DEBUG__', 0);
define('__OB_GZHANDLER_ENABLE__', 1);
/**
* @brief 간단하게 사용하기 위한 함수 정의한 파일 require