Example #1
0
 /**
  *  引入文件 include 语法处理
  *
  * @access    public
  * @param     string  $filename  文件名
  * @param     string  $isload  是否载入
  * @return    string
  */
 function CompilerInclude($filename, $isload = TRUE)
 {
     $okfile = '';
     if (@file_exists($filename)) {
         $okfile = $filename;
     } else {
         if (@file_exists($this->refDir . $filename)) {
             $okfile = $this->refDir . $filename;
         } else {
             if (@file_exists($this->refDir . "../" . $filename)) {
                 $okfile = $this->refDir . "../" . $filename;
             }
         }
     }
     if ($okfile == '') {
         return 0;
     }
     if (!$isload) {
         return 1;
     }
     $itpl = new STTemplate($this->templateDir);
     $itpl->isCache = $this->isCache;
     $itpl->SetObject($this->refObj);
     $itpl->LoadTemplate($okfile);
     return $itpl->CacheFile();
 }