mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-14 00:39:57 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@1199 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
edd3931046
commit
46ceabcbb9
4 changed files with 26 additions and 7 deletions
|
|
@ -31,6 +31,7 @@
|
|||
Context::set('content', $content);
|
||||
|
||||
// 레이아웃을 컴파일
|
||||
if(__DEBUG__==3) $start = getMicroTime();
|
||||
require_once("./classes/template/TemplateHandler.class.php");
|
||||
$oTemplate = new TemplateHandler();
|
||||
|
||||
|
|
@ -39,10 +40,13 @@
|
|||
if(!$layout_path) $layout_path = './common/tpl/';
|
||||
if(!$layout_file) $layout_file = 'default_layout.html';
|
||||
$zbxe_final_content = $oTemplate->compile($layout_path, $layout_file);
|
||||
if(__DEBUG__==3) $GLOBALS['__layout_compile_elapsed__'] = getMicroTime()-$start;
|
||||
|
||||
// 각 플러그인, 에디터 컴포넌트의 코드 변경
|
||||
if(__DEBUG__==3) $start = getMicroTime();
|
||||
$oContext = &Context::getInstance();
|
||||
$zbxe_final_content= $oContext->transContent($zbxe_final_content);
|
||||
if(__DEBUG__==3) $GLOBALS['__trans_plugin_editor_elapsed__'] = getMicroTime()-$start;
|
||||
|
||||
// 최종 결과를 common_layout에 넣어버림
|
||||
Context::set('zbxe_final_content', $zbxe_final_content);
|
||||
|
|
@ -172,6 +176,15 @@
|
|||
$buff .= sprintf("\tTemplate compile elapsed time\t: %0.5f sec\n", $GLOBALS['__template_elapsed__']);
|
||||
$buff .= sprintf("\tXmlParse compile elapsed time\t: %0.5f sec\n", $GLOBALS['__xmlparse_elapsed__']);
|
||||
$buff .= sprintf("\tPHP elapsed time \t\t: %0.5f sec\n", $end-__StartTime__-$GLOBALS['__template_elapsed__']-$GLOBALS['__xmlparse_elapsed__']-$GLOBALS['__db_elapsed_time__']-$GLOBALS['__elapsed_class_load__']);
|
||||
|
||||
// 플러그인 실행 시간 작성
|
||||
$buff .= sprintf("\n\tPlugins elapsed time \t\t: %0.5f sec", $GLOBALS['__plugin_excute_elapsed__']);
|
||||
|
||||
// 레이아웃 실행 시간
|
||||
$buff .= sprintf("\n\tLayout compile elapsed time \t: %0.5f sec", $GLOBALS['__layout_compile_elapsed__']);
|
||||
|
||||
// 플러그인, 에디터 컴포넌트 치환 시간
|
||||
$buff .= sprintf("\n\tTrans plugin&editor elapsed time: %0.5f sec\n\n", $GLOBALS['__trans_plugin_editor_elapsed__']);
|
||||
}
|
||||
|
||||
// 전체 실행 시간 작성
|
||||
|
|
|
|||
|
|
@ -14,12 +14,20 @@
|
|||
* <div plugin='플러그인'...></div> 태그 사용 templateHandler에서 PluginHandler::execute()를 실행하는 코드로 대체하게 된다
|
||||
**/
|
||||
function execute($plugin, $args) {
|
||||
// 디버그를 위한 플러그인 실행 시간 저장
|
||||
if(__DEBUG__==3) $start = getMicroTime();
|
||||
|
||||
// $plugin의 객체를 받음
|
||||
$oPlugin = PluginHandler::getObject($plugin);
|
||||
if(!$oPlugin) return;
|
||||
|
||||
// 플러그인 실행
|
||||
return $oPlugin->proc($args);
|
||||
if($oPlugin) {
|
||||
$output = $oPlugin->proc($args);
|
||||
}
|
||||
|
||||
if(__DEBUG__==3) $GLOBALS['__plugin_excute_elapsed__'] += getMicroTime() - $start;
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -42,12 +42,11 @@
|
|||
// 일단 컴파일
|
||||
$buff = $this->_compile($tpl_file, $compiled_tpl_file);
|
||||
|
||||
if(__DEBUG__==3) $GLOBALS['__template_elapsed__'] += getMicroTime() - $start;
|
||||
|
||||
// Context와 compiled_tpl_file로 컨텐츠 생성
|
||||
$output = $this->_fetch($compiled_tpl_file, $buff);
|
||||
|
||||
// 컴파일된 파일을 실행
|
||||
if(__DEBUG__==3) $GLOBALS['__template_elapsed__'] += getMicroTime() - $start;
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -57,8 +57,7 @@
|
|||
function compile() {
|
||||
if(!file_exists($this->xml_file)) return;
|
||||
if(!file_exists($this->js_file)) $this->_compile();
|
||||
if(filectime($this->xml_file)>filectime($this->js_file)) $this->_compile();
|
||||
$this->_compile();
|
||||
else if(filectime($this->xml_file)>filectime($this->js_file)) $this->_compile();
|
||||
Context::addJsFile($this->js_file);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue