diff --git a/classes/display/DisplayHandler.class.php b/classes/display/DisplayHandler.class.php index e6f8664a5..4af80538d 100644 --- a/classes/display/DisplayHandler.class.php +++ b/classes/display/DisplayHandler.class.php @@ -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); } diff --git a/config/config.inc.php b/config/config.inc.php index 1ffc8fab1..f52ae2d9d 100644 --- a/config/config.inc.php +++ b/config/config.inc.php @@ -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