diff --git a/libs/core/core.write_compiled_resource.php b/libs/core/core.write_compiled_resource.php index 09b50d3b..c701448c 100644 --- a/libs/core/core.write_compiled_resource.php +++ b/libs/core/core.write_compiled_resource.php @@ -25,10 +25,9 @@ function smarty_core_write_compiled_resource($params, &$smarty) return false; } - $_params = array('filename' => $params['compile_path'], 'contents' => $params['compiled_content'], 'create_dirs' => true); + $_params = array('filename' => $params['compile_path'], 'timestamp'=>$params['resource_timestamp'], 'contents' => $params['compiled_content'], 'create_dirs' => true); require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.write_file.php'); smarty_core_write_file($_params, $smarty); - touch($params['compile_path'], $params['resource_timestamp']); return true; } diff --git a/libs/core/core.write_file.php b/libs/core/core.write_file.php index c92454d4..b4fa92e5 100644 --- a/libs/core/core.write_file.php +++ b/libs/core/core.write_file.php @@ -33,6 +33,9 @@ function smarty_core_write_file($params, &$smarty) } fwrite($fd, $params['contents']); + if (isset($params['timestamp'])) { + touch($_tmp_file, $params['timestamp']); + } fclose($fd); if(file_exists($params['filename'])) { @unlink($params['filename']);