TemplateHandler 클래스 참조

템플릿 컴파일러 더 자세히 ...

TemplateHandler에 대한 상속 다이어그램 :

Inheritance graph
TemplateHandler에 대한 협력 다이어그램:

Collaboration graph

모든 멤버 목록

Public 멤버 함수

getInstance ()
 TemplateHandler의 기생성된 객체를 return.
 compile ($tpl_path, $tpl_filename, $tpl_file= '')
 주어진 tpl파일의 컴파일
 compileDirect ($tpl_path, $tpl_filename)
 주어진 파일을 컴파일 후 바로 return
 _compile ($tpl_file, $compiled_tpl_file)
 tpl_file이 컴파일이 되어 있는 것이 있는지 체크
 _compileTplFile ($tpl_file, $compiled_tpl_file= '')
 tpl_file을 compile
 _compileVarToContext ($matches)
 {$와 } 안의 $... 변수를 Context::get(...) 으로 변경
 _compileImgPath ($matches)
 이미지의 경로를 변경
 _compileVarToSilenceExecute ($matches)
 {@와 } 안의 @... 함수를 print func(..)로 변경
 _compileFuncToCode ($matches)
 사이의 구문을 php코드로 변경
 _compileIncludeToCode ($matches)
 를 변환
 _compileImportCode ($matches)
 의 확장자를 봐서 js filter/ css/ js 파일을 include하도록 수정
 _compileLoadJavascriptPlugin ($matches)
 javascript 플러그인 import javascript 플러그인의 경우 optimized = false로 동작하도록 고정시킴
 _compileUnloadCode ($matches)
 의 확장자를 봐서 css/ js 파일을 제거하도록 수정
 _getCompiledFileName ($tpl_file)
 $tpl_file로 compiled_tpl_file이름을 return
 _fetch ($compiled_tpl_file, $buff=NULL, $tpl_path= '')
 ob_* 함수를 이용하여 fetch...

Public 속성

 $compiled_path = './files/cache/template_compiled/'
 컴파일된 캐쉬 파일이 놓일 위치
 $tpl_path = ''
 컴파일 대상 경로
 $tpl_file = ''
 컴파일 대상 파일


상세한 설명

템플릿 컴파일러

작성자:
zero (zero@nzeo.com)
버전:
0.1
정규표현식을 이용하여 템플릿 파일을 컴파일하여 php코드로 변경하고 이 파일을 caching하여 사용할 수 있도록 하는 템플릿 컴파일러

TemplateHandler.class.php 파일의 11 번째 라인에서 정의되었습니다.


멤버 함수 문서화

TemplateHandler::_compile ( tpl_file,
compiled_tpl_file 
)

tpl_file이 컴파일이 되어 있는 것이 있는지 체크

TemplateHandler.class.php 파일의 83 번째 라인에서 정의되었습니다.

다음을 참조함 : $tpl_file, _compileTplFile(), FileHandler::getRealPath().

다음에 의해서 참조됨 : compile().

00083                                                          {
00084             if(!file_exists($compiled_tpl_file)) return $this->_compileTplFile($tpl_file, $compiled_tpl_file);
00085 
00086             $source_ftime = filemtime(FileHandler::getRealPath($tpl_file));
00087             $target_ftime = filemtime($compiled_tpl_file);
00088             if($source_ftime>$target_ftime || $target_ftime < filemtime(_XE_PATH_.'classes/template/TemplateHandler.class.php') ) return $this->_compileTplFile($tpl_file, $compiled_tpl_file);
00089         }

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

TemplateHandler::_compileFuncToCode ( matches  ) 

사이의 구문을 php코드로 변경

TemplateHandler.class.php 파일의 200 번째 라인에서 정의되었습니다.

다음을 참조함 : $output, elseif.

00200                                               {
00201             static $idx = 0;
00202             $code = trim($matches[1]);
00203             if(!$code) return;
00204 
00205             switch(strtolower($code)) {
00206                 case 'else' :
00207                         $output = '}else{';
00208                     break;
00209                 case 'end' :
00210                 case 'endif' :
00211                 case 'endfor' :
00212                 case 'endforeach' :
00213                 case 'endswitch' :
00214                         $output = '}';
00215                     break;
00216                 case 'break' :
00217                         $output = 'break;';
00218                     break;
00219                 case 'default' :
00220                         $output = 'default :';
00221                     break;
00222                 case 'break@default' :
00223                         $output = 'break; default :';
00224                     break;
00225                 default :
00226                         $suffix = '{';
00227 
00228                         if(substr($code, 0, 4) == 'else') {
00229                             $code = '}'.$code;
00230                         } elseif(substr($code, 0, 7) == 'foreach') {
00231                             $tmp_str = substr($code, 8);
00232                             $tmp_arr = explode(' ', $tmp_str);
00233                             $var_name = $tmp_arr[0];
00234                             $prefix = '$Context->__idx['.$idx.']=0;';
00235                             if(substr($var_name, 0, 1) == '$') {
00236                                 $prefix .= sprintf('if(count($__Context->%s)) ', substr($var_name, 1));
00237                             } else {
00238                                 $prefix .= sprintf('if(count(%s)) ', $var_name);
00239                             }
00240                             $idx++;
00241                             $suffix .= '$__idx['.$idx.']=($__idx['.$idx.']+1)%2; $cycle_idx = $__idx['.$idx.']+1;';
00242                         } elseif(substr($code, 0, 4) == 'case') {
00243                             $suffix = ':';
00244                         } elseif(substr($code, 0, 10) == 'break@case') {
00245                             $code = 'break; case'.substr($code, 10);
00246                             $suffix = ':';
00247                         }
00248                         $output = preg_replace('/\$([a-zA-Z0-9\_\-]+)/i', '$__Context->\\1', $code.$suffix);
00249                     break;
00250             }
00251 
00252             return sprintf('<?php %s %s ?>', $prefix, $output);
00253         }

TemplateHandler::_compileImgPath ( matches  ) 

이미지의 경로를 변경

TemplateHandler.class.php 파일의 169 번째 라인에서 정의되었습니다.

다음을 참조함 : Context::getRequestUri(), null.

00169                                            {
00170             static $real_path = null;
00171             $str1 = $matches[0];
00172             $str2 = $path = trim($matches[3]);
00173 
00174             if(substr($path,0,1)=='/' || substr($path,0,1)=='{' || strpos($path,'://')!==false) return $str1;
00175             if(substr($path,0,2)=='./') $path = substr($path,2);
00176 
00177             if(is_null($real_path)) {
00178                 $url = parse_url(Context::getRequestUri());
00179                 $real_path = $url['path'];
00180             }
00181 
00182             $target = $real_path.$this->tpl_path.$path;
00183             while(strpos($target,'/../')!==false) {
00184                 $target = preg_replace('/\/([^\/]+)\/\.\.\//','/',$target);
00185             }
00186             return str_replace($str2, $target, $str1);
00187         }

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

TemplateHandler::_compileImportCode ( matches  ) 

의 확장자를 봐서 js filter/ css/ js 파일을 include하도록 수정

TemplateHandler.class.php 파일의 313 번째 라인에서 정의되었습니다.

다음을 참조함 : $output.

00313                                               {
00314             // 현재 tpl 파일의 위치를 구해서 $base_path에 저장하여 적용하려는 xml file을 찾음
00315             $base_path = $this->tpl_path;
00316             $given_file = trim($matches[1]);
00317             if(!$given_file) return;
00318             if(isset($matches[3])) $optimized = strtolower(trim($matches[3]));
00319             if(!$optimized) $optimized = 'true';
00320             if(isset($matches[5])) $media = trim($matches[5]);
00321             if(!$media) $media = 'all';
00322             if(isset($matches[7])) $targetie = trim($matches[7]);
00323             if(!$targetie) $targetie = '';
00324             else $optimized = 'false';
00325 
00326             // given_file이 lang으로 끝나게 되면 언어팩을 읽도록 함
00327             if(substr($given_file, -4)=='lang') {
00328                 if(substr($given_file,0,2)=='./') $given_file = substr($given_file, 2);
00329                 $lang_dir = sprintf('%s%s', $this->tpl_path, $given_file);
00330                 if(is_dir($lang_dir)) $output = sprintf('<?php Context::loadLang("%s"); ?>', $lang_dir);
00331 
00332             // load lang이 아니라면 xml, css, js파일을 읽도록 시도
00333             } else {
00334                 if(substr($given_file,0,1)!='/') $source_filename = sprintf("%s%s",$base_path, $given_file);
00335                 else $source_filename = $given_file;
00336 
00337                 // path와 파일이름을 구함
00338                 $tmp_arr = explode("/",$source_filename);
00339                 $filename = array_pop($tmp_arr);
00340 
00341                 $base_path = implode("/",$tmp_arr)."/";
00342 
00343                 // 확장자를 구함
00344                 $tmp_arr = explode(".",$filename);
00345                 $ext = strtolower(array_pop($tmp_arr));
00346 
00347                 // 확장자에 따라서 파일 import를 별도로
00348                 switch($ext) {
00349                     // xml js filter
00350                     case 'xml' :
00351                             // XmlJSFilter 클래스의 객체 생성후 js파일을 만들고 Context::addJsFile처리
00352                             $output = sprintf(
00353                                 '<?php%s'.
00354                                 'require_once("./classes/xml/XmlJsFilter.class.php");%s'.
00355                                 '$oXmlFilter = new XmlJSFilter("%s","%s");%s'.
00356                                 '$oXmlFilter->compile();%s'.
00357                                 '?>%s',
00358                                 "\n",
00359                                 "\n",
00360                                 $base_path,
00361                                 $filename,
00362                                 "\n",
00363                                 "\n",
00364                                 "\n"
00365                                 );
00366                         break;
00367                     // css file
00368                     case 'css' :
00369                             if(preg_match('/^(http|\/)/i',$source_filename)) {
00370                                 $output = sprintf('<?php Context::addCSSFile("%s", %s, "%s", "%s"); ?>', $source_filename, 'false', $media, $targetie);
00371                             } else {
00372                                 $meta_file = sprintf('%s%s', $base_path, $filename);
00373                                 $output = sprintf('<?php Context::addCSSFile("%s%s", %s, "%s", "%s"); ?>', $base_path, $filename, $optimized, $media, $targetie);
00374                             }
00375                         break;
00376                     // js file
00377                     case 'js' :
00378                             if(preg_match('/^(http|\/)/i',$source_filename)) {
00379                                 $output = sprintf('<?php Context::addJsFile("%s", %s, "%s"); ?>', $source_filename, 'false', $targetie);
00380                             } else {
00381                                 $meta_file = sprintf('%s%s', $base_path, $filename);
00382                                 $output = sprintf('<?php Context::addJsFile("%s%s", %s, "%s"); ?>', $base_path, $filename, $optimized, $targetie);
00383                             }
00384                         break;
00385                 }
00386             }
00387 
00388             if($meta_file) $output = '<!--Meta:'.$meta_file.'-->'.$output;
00389             return $output;
00390         }

TemplateHandler::_compileIncludeToCode ( matches  ) 

를 변환

TemplateHandler.class.php 파일의 258 번째 라인에서 정의되었습니다.

다음을 참조함 : $output, Context::get().

00258                                                  {
00259             // include하려는 대상문자열에 변수가 있으면 변수 처리
00260             $arg = str_replace(array('"','\''), '', $matches[1]);
00261             if(!$arg) return;
00262 
00263             $tmp_arr = explode("/", $arg);
00264             for($i=0;$i<count($tmp_arr);$i++) {
00265                 $item1 = trim($tmp_arr[$i]);
00266                 if($item1=='.'||substr($item1,-5)=='.html') continue;
00267 
00268                 $tmp2_arr = explode(".",$item1);
00269                 for($j=0;$j<count($tmp2_arr);$j++) {
00270                     $item = trim($tmp2_arr[$j]);
00271                     if(substr($item,0,1)=='$') $item = Context::get(substr($item,1));
00272                     $tmp2_arr[$j] = $item;
00273                 }
00274                 $tmp_arr[$i] = implode(".",$tmp2_arr);
00275             }
00276             $arg = implode("/",$tmp_arr);
00277             if(substr($arg,0,2)=='./') $arg = substr($arg,2);
00278 
00279             // 1단계로 해당 tpl 내의 파일을 체크
00280             $source_filename = sprintf("%s/%s", dirname($this->tpl_file), $arg);
00281 
00282             // 2단계로 root로부터 경로를 체크
00283             if(!file_exists($source_filename)) $source_filename = './'.$arg;
00284             if(!file_exists($source_filename)) return;
00285 
00286             // path, filename으로 분리
00287             $tmp_arr = explode('/', $source_filename);
00288             $filename = array_pop($tmp_arr);
00289             $path = implode('/', $tmp_arr).'/';
00290 
00291             // include 시도
00292             $output = sprintf(
00293                 '<?php%s'.
00294                 '$oTemplate = &TemplateHandler::getInstance();%s'.
00295                 'print $oTemplate->compile(\'%s\',\'%s\');%s'.
00296                 '?>%s',
00297 
00298                 "\n",
00299 
00300                 "\n",
00301 
00302                 $path, $filename, "\n",
00303 
00304                 "\n"
00305             );
00306 
00307             return $output;
00308         }

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

TemplateHandler::_compileLoadJavascriptPlugin ( matches  ) 

javascript 플러그인 import javascript 플러그인의 경우 optimized = false로 동작하도록 고정시킴

TemplateHandler.class.php 파일의 396 번째 라인에서 정의되었습니다.

00396                                                         {
00397             $base_path = $this->tpl_path;
00398             $plugin = trim($matches[1]);
00399             return sprintf('<?php Context::loadJavascriptPlugin("%s"); ?>', $plugin);
00400         }

TemplateHandler::_compileTplFile ( tpl_file,
compiled_tpl_file = '' 
)

tpl_file을 compile

TemplateHandler.class.php 파일의 94 번째 라인에서 정의되었습니다.

다음을 참조함 : $tpl_file, FileHandler::readFile(), FileHandler::writeFile().

다음에 의해서 참조됨 : _compile(), compileDirect().

00094                                                                      {
00095 
00096             // tpl 파일을 읽음
00097             $buff = FileHandler::readFile($tpl_file);
00098             if(!$buff) return;
00099 
00100             // include 변경 <!--#include($filename)-->
00101             $buff = preg_replace_callback('!<\!--#include\(([^\)]*?)\)-->!is', array($this, '_compileIncludeToCode'), $buff);
00102 
00103             // 이미지 태그 img의 src의 값이 ./ 또는 파일이름으로 바로 시작하면 경로 변경
00104             $buff = preg_replace_callback('/<(img|input)([^>]*)src=[\'"]{1}(.*?)[\'"]{1}/is', array($this, '_compileImgPath'), $buff);
00105 
00106             // 변수를 변경
00107             $buff = preg_replace_callback('/\{[^@^ ]([^\{\}\n]+)\}/i', array($this, '_compileVarToContext'), $buff);
00108 
00109             // 결과를 출력하지 않는 구문 변경
00110             $buff = preg_replace_callback('/\{\@([^\{\}]+)\}/i', array($this, '_compileVarToSilenceExecute'), $buff);
00111 
00112             // <!--@, --> 의 변경
00113             $buff = preg_replace_callback('!<\!--@(.*?)-->!is', array($this, '_compileFuncToCode'), $buff);
00114 
00115             // <!--// ~ --> 주석문 제거
00116             $buff = preg_replace('!(\n?)( *?)<\!--//(.*?)-->!is', '', $buff);
00117 
00118             // import xml filter/ css/ js/ 언어파일 <!--%import("filename"[,optimized=true|false][,media="media"][,targetie="lt IE 6|IE 7|gte IE 8|..."])--> (media는 css에만 적용)
00119             $buff = preg_replace_callback('!<\!--%import\(\"([^\"]*?)\"(,optimized\=(true|false))?(,media\=\"([^\"]*)\")?(,targetie=\"([^\"]*)\")?\)-->!is', array($this, '_compileImportCode'), $buff);
00120 
00121             // unload css/ js <!--%unload("filename"[,optimized=true|false][,media="media"][,targetie="lt IE 6|IE 7|gte IE 8|..."])--> (media는 css에만 적용)
00122             $buff = preg_replace_callback('!<\!--%unload\(\"([^\"]*?)\"(,optimized\=(true|false))?(,media\=\"([^\"]*)\")?(,targetie=\"([^\"]*)\")?\)-->!is', array($this, '_compileUnloadCode'), $buff);
00123 
00124             // javascript plugin import
00125             $buff = preg_replace_callback('!<\!--%load_js_plugin\(\"([^\"]*?)\"\)-->!is', array($this, '_compileLoadJavascriptPlugin'), $buff);
00126 
00127             // 파일에 쓰기 전에 직접 호출되는 것을 방지
00128             $buff = sprintf('%s%s%s','<?php if(!defined("__ZBXE__")) exit();?>',"\n",$buff);
00129 
00130             // 컴파일된 코드를 파일에 저장
00131             if($compiled_tpl_file) FileHandler::writeFile($compiled_tpl_file, $buff);
00132 
00133             return $buff;
00134         }

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

TemplateHandler::_compileUnloadCode ( matches  ) 

의 확장자를 봐서 css/ js 파일을 제거하도록 수정

TemplateHandler.class.php 파일의 405 번째 라인에서 정의되었습니다.

다음을 참조함 : $output.

00405                                               {
00406             // 현재 tpl 파일의 위치를 구해서 $base_path에 저장하여 적용하려는 xml file을 찾음
00407             $base_path = $this->tpl_path;
00408             $given_file = trim($matches[1]);
00409             if(!$given_file) return;
00410             if(isset($matches[3])) $optimized = strtolower(trim($matches[3]));
00411             if(!$optimized) $optimized = 'true';
00412             if(isset($matches[5])) $media = trim($matches[5]);
00413             if(!$media) $media = 'all';
00414             if(isset($matches[7])) $targetie = trim($matches[7]);
00415             if(!$targetie) $targetie = '';
00416             else $optimized = 'false';
00417 
00418             if(substr($given_file,0,1)!='/') $source_filename = sprintf("%s%s",$base_path, $given_file);
00419             else $source_filename = $given_file;
00420 
00421             // path와 파일이름을 구함
00422             $tmp_arr = explode("/",$source_filename);
00423             $filename = array_pop($tmp_arr);
00424 
00425             $base_path = implode("/",$tmp_arr)."/";
00426 
00427             // 확장자를 구함
00428             $tmp_arr = explode(".",$filename);
00429             $ext = strtolower(array_pop($tmp_arr));
00430 
00431             // 확장자에 따라서 파일 import를 별도로
00432             switch($ext) {
00433                 // css file
00434                 case 'css' :
00435                         if(preg_match('/^(http|\/)/i',$source_filename)) {
00436                             $output = sprintf('<?php Context::unloadCSSFile("%s", %s, "%s", "%s"); ?>', $source_filename, 'false', $media, $targetie);
00437                         } else {
00438                             $meta_file = sprintf('%s%s', $base_path, $filename);
00439                             $output = sprintf('<?php Context::unloadCSSFile("%s%s", %s, "%s", "%s"); ?>', $base_path, $filename, $optimized, $media, $targetie);
00440                         }
00441                     break;
00442                 // js file
00443                 case 'js' :
00444                         if(preg_match('/^(http|\/)/i',$source_filename)) {
00445                             $output = sprintf('<?php Context::unloadJsFile("%s", %s, "%s"); ?>', $source_filename, 'false', $targetie);
00446                         } else {
00447                             $meta_file = sprintf('%s%s', $base_path, $filename);
00448                             $output = sprintf('<?php Context::unloadJsFile("%s%s", %s, "%s"); ?>', $base_path, $filename, $optimized, $targetie);
00449                         }
00450                     break;
00451             }
00452 
00453             return $output;
00454         }

TemplateHandler::_compileVarToContext ( matches  ) 

{$와 } 안의 $... 변수를 Context::get(...) 으로 변경

TemplateHandler.class.php 파일의 139 번째 라인에서 정의되었습니다.

00139                                                 {
00140             $str = trim(substr($matches[0],1,strlen($matches[0])-2));
00141             if(!$str) return $matches[0];
00142             if(!in_array(substr($str,0,1),array('(','$','\'','"'))) {
00143                 if(preg_match('/^([^\( \.]+)(\(| \.)/i',$str,$m)) {
00144                     $func = trim($m[1]);
00145                     if(strpos($func,'::')===false) {
00146                         if(!function_exists($func)) {
00147                             return $matches[0];
00148                         }
00149                     } else {
00150                         list($class, $method) = explode('::',$func);
00151                         if(!class_exists($class)  || !in_array($method, get_class_methods($class))) {
00152                             // 서버 환경에 따라서 class, method가 대소문자 구별을 할때와 하지 않을때가 있음
00153                             list($class, $method) = explode('::',strtolower($func));
00154                             if(!class_exists($class)  || !in_array($method, get_class_methods($class))) {
00155                                 return $matches[0];
00156                             }
00157                         }
00158                     }
00159                 } else {
00160                     if(!defined($str)) return $matches[0];
00161                 }
00162             }
00163             return '<?php @print('.preg_replace('/\$([a-zA-Z0-9\_\->]+)/i','$__Context->\\1', $str).');?>';
00164         }

TemplateHandler::_compileVarToSilenceExecute ( matches  ) 

{@와 } 안의 @... 함수를 print func(..)로 변경

TemplateHandler.class.php 파일의 192 번째 라인에서 정의되었습니다.

00192                                                        {
00193             if(strtolower(trim(str_replace(array(';',' '),'', $matches[1])))=='return') return '<?php return; ?>';
00194             return '<?php @'.preg_replace('/\$([a-zA-Z0-9\_\->]+)/i','$__Context->\\1', trim($matches[1])).';?>';
00195         }

TemplateHandler::_fetch ( compiled_tpl_file,
buff = NULL,
tpl_path = '' 
)

ob_* 함수를 이용하여 fetch...

TemplateHandler.class.php 파일의 466 번째 라인에서 정의되었습니다.

다음을 참조함 : $GLOBALS, $tpl_path.

다음에 의해서 참조됨 : compile().

00466                                                                           {
00467             $__Context = &$GLOBALS['__Context__'];
00468             $__Context->tpl_path = $tpl_path;
00469 
00470             if($_SESSION['is_logged']) $__Context->logged_info = $_SESSION['logged_info'];
00471 
00472             // ob_start를 시킨후 컴파일된 tpl파일을 include하고 결과를 return
00473             ob_start();
00474 
00475             // tpl파일을 compile하지 못할 경우 $buff로 넘어온 값을 eval시킴 (미설치시에나..)
00476             if($buff) {
00477                 $eval_str = "?>".$buff;
00478                 eval($eval_str);
00479             } else {
00480                 @include($compiled_tpl_file);
00481             }
00482 
00483             return ob_get_clean();
00484         }

TemplateHandler::_getCompiledFileName ( tpl_file  ) 

$tpl_file로 compiled_tpl_file이름을 return

TemplateHandler.class.php 파일의 459 번째 라인에서 정의되었습니다.

다음을 참조함 : $tpl_file.

다음에 의해서 참조됨 : compile().

00459                                                  {
00460             return sprintf('%s%s.compiled.php',$this->compiled_path, md5($tpl_file));
00461         }

TemplateHandler::compile ( tpl_path,
tpl_filename,
tpl_file = '' 
)

주어진 tpl파일의 컴파일

TemplateHandler.class.php 파일의 36 번째 라인에서 정의되었습니다.

다음을 참조함 : $GLOBALS, $output, $tpl_file, $tpl_path, _compile(), _fetch(), _getCompiledFileName(), getMicroTime(), FileHandler::getRealPath().

00036                                                                    {
00037             // 디버그를 위한 컴파일 시작 시간 저장
00038             if(__DEBUG__==3 ) $start = getMicroTime();
00039 
00040             // 변수 체크
00041             if(substr($tpl_path,-1)!='/') $tpl_path .= '/';
00042             if(substr($tpl_filename,-5)!='.html') $tpl_filename .= '.html';
00043 
00044             // tpl_file 변수 생성
00045             if(!$tpl_file) $tpl_file = $tpl_path.$tpl_filename;
00046 
00047             // tpl_file이 비어 있거나 해당 파일이 없으면 return
00048             if(!$tpl_file || !file_exists(FileHandler::getRealPath($tpl_file))) return;
00049 
00050             $this->tpl_path = preg_replace('/^\.\//','',$tpl_path);
00051             $this->tpl_file = $tpl_file;
00052 
00053             // compiled된(or 될) 파일이름을 구함
00054             $compiled_tpl_file = FileHandler::getRealPath($this->_getCompiledFileName($tpl_file));
00055 
00056             // 일단 컴파일
00057             $buff = $this->_compile($tpl_file, $compiled_tpl_file);
00058 
00059             // Context와 compiled_tpl_file로 컨텐츠 생성
00060             $output = $this->_fetch($compiled_tpl_file, $buff, $tpl_path);
00061 
00062             if(__DEBUG__==3 ) $GLOBALS['__template_elapsed__'] += getMicroTime() - $start;
00063 
00064             return $output;
00065         }

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

TemplateHandler::compileDirect ( tpl_path,
tpl_filename 
)

주어진 파일을 컴파일 후 바로 return

TemplateHandler.class.php 파일의 70 번째 라인에서 정의되었습니다.

다음을 참조함 : $tpl_file, $tpl_path, _compileTplFile().

00070                                                          {
00071             $this->tpl_path = $tpl_path;
00072             $this->tpl_file = $tpl_file;
00073 
00074             $tpl_file = $tpl_path.$tpl_filename;
00075             if(!file_exists($tpl_file)) return;
00076 
00077             return $this->_compileTplFile($tpl_file);
00078         }

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

& TemplateHandler::getInstance (  ) 

TemplateHandler의 기생성된 객체를 return.

TemplateHandler.class.php 파일의 21 번째 라인에서 정의되었습니다.

다음을 참조함 : $GLOBALS.

다음에 의해서 참조됨 : content::_compile(), DisplayHandler::_toHTMLDoc(), layoutAdminView::dispLayoutAdminLayoutModify(), layoutModel::doActivateFaceOff(), opageView::executeFile(), documentModel::getCategoryHTML(), communicationAdminModel::getCommunicationAdminColorset(), documentModel::getDocumentCategoryTplInfo(), documentModel::getExtraVarsHTML(), planetModel::getInterestTagsHtml(), memberAdminModel::getMemberAdminColorset(), planetModel::getMemoHtml(), menuAdminModel::getMenuAdminTplInfo(), moduleAdminModel::getModuleSkinHTML(), pollModel::getPollHtml(), pollModel::getPollResultHtml(), quotation::getPopupContent(), poll_maker::getPopupContent(), naver_map::getPopupContent(), multimedia_link::getPopupContent(), image_link::getPopupContent(), image_gallery::getPopupContent(), emoticon::getPopupContent(), code_highlighter::getPopupContent(), cc_license::getPopupContent(), planetModel::getReplyHtml(), memberController::insertMember(), DisplayHandler::printContent(), webzine::proc(), tag_list::proc(), tab_newest_document::proc(), site_info::proc(), rank_point::proc(), rank_download::proc(), rank_count::proc(), point_status::proc(), planet_document::proc(), newest_trackback::proc(), newest_images::proc(), newest_document::proc(), newest_comment::proc(), member_group::proc(), login_info::proc(), logged_members::proc(), language_select::proc(), forum::proc(), DroArc_clock::proc(), counter_status::proc(), category::proc(), calendar::proc(), archive_list::proc(), memberController::procMemberFindAccount(), memberController::procMemberUpdateAuthMail(), image_gallery::transHTML(), commentView::triggerDispCommentAdditionSetup(), documentView::triggerDispDocumentAdditionSetup(), editorView::triggerDispEditorAdditionSetup(), fileView::triggerDispFileAdditionSetup(), pointView::triggerDispPointAdditionSetup(), rssView::triggerDispRssAdditionSetup(), trackbackView::triggerDispTrackbackAdditionSetup().

00021                                 {
00022             if(__DEBUG__==3 ) {
00023                 if(!isset($GLOBALS['__TemplateHandlerCalled__'])) $GLOBALS['__TemplateHandlerCalled__']=1;
00024                 else $GLOBALS['__TemplateHandlerCalled__']++;
00025             }
00026 
00027             if(!$GLOBALS['__TemplateHandler__']) {
00028                 $GLOBALS['__TemplateHandler__'] = new TemplateHandler();
00029             }
00030             return $GLOBALS['__TemplateHandler__'];
00031         }


멤버 데이타 문서화

TemplateHandler::$compiled_path = './files/cache/template_compiled/'

컴파일된 캐쉬 파일이 놓일 위치

TemplateHandler.class.php 파일의 13 번째 라인에서 정의되었습니다.

TemplateHandler::$tpl_file = ''

컴파일 대상 파일

TemplateHandler.class.php 파일의 16 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : _compile(), _compileTplFile(), _getCompiledFileName(), compile(), compileDirect().

TemplateHandler::$tpl_path = ''

컴파일 대상 경로

TemplateHandler.class.php 파일의 15 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : _fetch(), compile(), compileDirect().


이 클래스에 대한 문서화 페이지는 다음의 파일로부터 생성되었습니다.:

생성시간 : Wed Jun 3 15:15:45 2009, 프로젝트명 : XpressEngine, 생성자 :   doxygen 1.5.8