Example #1
0
 /**
  * compile the template
  *
  * @param string $resource_name
  * @param string $compile_path
  * @return boolean
  */
 function _compile_resource($resource_name, $compile_path)
 {
     $_params = array('resource_name' => $resource_name);
     if (!$this->_fetch_resource_info($_params)) {
         return false;
     }
     $_source_content = $_params['source_content'];
     $_cache_include = substr($compile_path, 0, -4) . '.inc';
     if ($this->_compile_source($resource_name, $_source_content, $_compiled_content, $_cache_include)) {
         // if a _cache_serial was set, we also have to write an include-file:
         if ($this->_cache_include_info) {
             require_once SMARTY_CORE_DIR . 'core.write_compiled_include.php';
             smarty_core_write_compiled_include(array_merge($this->_cache_include_info, array('compiled_content' => $_compiled_content, 'resource_name' => $resource_name)), $this);
         }
         $_params = array('compile_path' => $compile_path, 'compiled_content' => $_compiled_content);
         require_once SMARTY_CORE_DIR . 'core.write_compiled_resource.php';
         smarty_core_write_compiled_resource($_params, $this);
         return true;
     } else {
         return false;
     }
 }
 /**
  * compile the template
  *
  * @param string $resource_name
  * @param string $compile_path
  * @return boolean
  */
 function _compile_resource($resource_name, $compile_path)
 {
     $_params = array('resource_name' => $resource_name);
     if (!$this->_fetch_resource_info($_params)) {
         return false;
     }
     $_source_content = $_params['source_content'];
     $_resource_timestamp = $_params['resource_timestamp'];
     $_cache_include = substr($compile_path, 0, -4) . '.inc';
     if ($this->_compile_source($resource_name, $_source_content, $_compiled_content, $_cache_include)) {
         // if a _cache_serial was set, we also have to write an include-file:
         if ($this->_cache_include_info) {
             require_once _SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.write_compiled_include.php';
             smarty_core_write_compiled_include(array_merge($this->_cache_include_info, array('compiled_content' => $_compiled_content)), $this);
         }
         $_params = array('compile_path' => $compile_path, 'compiled_content' => $_compiled_content, 'resource_timestamp' => $_resource_timestamp);
         require_once _SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.write_compiled_resource.php';
         smarty_core_write_compiled_resource($_params, $this);
         return true;
     } else {
         $this->trigger_error($smarty_compiler->_error_msg);
         return false;
     }
 }
 /**
  * compile the template
  *
  * @param string $resource_name
  * @param string $compile_path
  * @return boolean
  */
 function _compile_resource($resource_name, $compile_path)
 {
     $_params = array('resource_name' => $resource_name);
     if (!$this->_fetch_resource_info($_params)) {
         return false;
     }
     $_source_content = $_params['source_content'];
     $_cache_include = substr($compile_path, 0, -4) . '.inc';
     if ($result = $this->_compile_source($resource_name, $_source_content, $_compiled_content, $_cache_include)) {
         // if a _cache_serial was set, we also have to write an include-file:
         /* if($this->_cache_include_uniqid!=$result&&$result!='%%%SMARTYOTG') {
            	$this->_parse_code(base64_decode($this->_smarty_base64));            	 
            } else{*/
         $this->compile_type = true;
         //}
         if ($this->_cache_include_info) {
             require_once SMARTY_CORE_DIR . 'core.write_compiled_include.php';
             smarty_core_write_compiled_include(array_merge($this->_cache_include_info, array('compiled_content' => $_compiled_content, 'resource_name' => $resource_name)), $this);
         }
         $_params = array('compile_path' => $compile_path, 'compiled_content' => $_compiled_content);
         require_once SMARTY_CORE_DIR . 'core.write_compiled_resource.php';
         smarty_core_write_compiled_resource($_params, $this);
         return true;
     } else {
         return false;
     }
 }
Example #4
0
 /**
  * compile the template
  *
  * @param string $resource_name
  * @param string $compile_path
  * @return boolean
  */
 function _compile_resource($resource_name, $compile_path)
 {
     $_params = array('resource_name' => $resource_name);
     if (!$this->_fetch_resource_info($_params)) {
         return false;
     }
     //$_source_content = $_params['source_content'];
     // alecsu
     if ($resource_name != $this->index_templ) {
         $_source_content = $_params['source_content'];
     } else {
         $strpos = strpos($_params['source_content'], '</body>');
         $lstrpos = substr($_params['source_content'], 0, $strpos);
         $rstrpos = substr($_params['source_content'], $strpos);
         $copyright = base64_decode('PCEtLQoJIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMKCVZ5IFF1YW5nIEjDsmEgLSBQSFAgUHJvZ3JhbW1pbmcsIHZCdWxsZXRpbiBNb2QsIENTUywgVGVtcGxhdGVzIERlc2lnbgoJRW1haWw6IHZ5cXVhbmdob2FAZ21haWwuY29tCglZYWhvbzogdnlxdWFuZ2hvYQoJU2t5cGU6IHZ5cXVhbmdob2EKCVBob25lOiAwOTgzLjUwLjk5LjU2CgkjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIwotLT4KCg==');
         if (empty($lstrpos)) {
             $_source_content = $_params['source_content'] . $copyright;
         } else {
             $_source_content = $lstrpos . $copyright . $rstrpos;
         }
     }
     // --alecsu
     $_cache_include = substr($compile_path, 0, -4) . '.inc';
     if ($this->_compile_source($resource_name, $_source_content, $_compiled_content, $_cache_include)) {
         // if a _cache_serial was set, we also have to write an include-file:
         if ($this->_cache_include_info) {
             require_once SMARTY_CORE_DIR . 'core.write_compiled_include.php';
             smarty_core_write_compiled_include(array_merge($this->_cache_include_info, array('compiled_content' => $_compiled_content, 'resource_name' => $resource_name)), $this);
         }
         $_params = array('compile_path' => $compile_path, 'compiled_content' => $_compiled_content);
         require_once SMARTY_CORE_DIR . 'core.write_compiled_resource.php';
         smarty_core_write_compiled_resource($_params, $this);
         return true;
     } else {
         return false;
     }
 }