mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 02:44:27 +02:00
fix _is_compiled logic
This commit is contained in:
@@ -1250,14 +1250,14 @@ reques * @var string
|
|||||||
// if we just need to display the results, don't perform output
|
// if we just need to display the results, don't perform output
|
||||||
// buffering - for speed
|
// buffering - for speed
|
||||||
if ($display && !$this->caching && count($this->_plugins['outputfilter']) == 0) {
|
if ($display && !$this->caching && count($this->_plugins['outputfilter']) == 0) {
|
||||||
if (!$this->_is_compiled($tpl_file, $_smarty_compile_path)
|
if ($this->_is_compiled($tpl_file, $_smarty_compile_path)
|
||||||
|| $this->_compile_template($tpl_file, $_smarty_compile_path))
|
|| $this->_compile_template($tpl_file, $_smarty_compile_path))
|
||||||
{
|
{
|
||||||
include($_smarty_compile_path);
|
include($_smarty_compile_path);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ob_start();
|
ob_start();
|
||||||
if (!$this->_is_compiled($tpl_file, $_smarty_compile_path)
|
if ($this->_is_compiled($tpl_file, $_smarty_compile_path)
|
||||||
|| $this->_compile_template($tpl_file, $_smarty_compile_path))
|
|| $this->_compile_template($tpl_file, $_smarty_compile_path))
|
||||||
{
|
{
|
||||||
include($_smarty_compile_path);
|
include($_smarty_compile_path);
|
||||||
@@ -1414,27 +1414,27 @@ reques * @var string
|
|||||||
if (!$this->force_compile && file_exists($compile_path)) {
|
if (!$this->force_compile && file_exists($compile_path)) {
|
||||||
if (!$this->compile_check) {
|
if (!$this->compile_check) {
|
||||||
// no need to check compiled file
|
// no need to check compiled file
|
||||||
return false;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
// get file source and timestamp
|
// get file source and timestamp
|
||||||
require_once(SMARTY_DIR . 'core/core.fetch_file_info.php');
|
require_once(SMARTY_DIR . 'core/core.fetch_file_info.php');
|
||||||
$_params = array('file_path' => $file_path);
|
$_params = array('file_path' => $file_path);
|
||||||
if (!smarty_core_fetch_file_info($_params, $this)) {
|
if (!smarty_core_fetch_file_info($_params, $this)) {
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
$_file_source = $_params['file_source'];
|
$_file_source = $_params['file_source'];
|
||||||
$_file_timestamp = $_params['file_timestamp'];
|
$_file_timestamp = $_params['file_timestamp'];
|
||||||
if ($_file_timestamp <= filemtime($compile_path)) {
|
if ($_file_timestamp <= filemtime($compile_path)) {
|
||||||
// template not expired, no recompile
|
// template not expired, no recompile
|
||||||
return false;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
// compile template
|
// compile template
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// compiled template does not exist, or forced compile
|
// compiled template does not exist, or forced compile
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user