From 08ff67c5bac270b6cd43144a90e1f67c8d9d9d6e Mon Sep 17 00:00:00 2001 From: messju Date: Mon, 12 Jul 2004 15:05:30 +0000 Subject: [PATCH] removed touch() call. changing the timestamp of the compiled-template to the source template's may be irritating for certain source-code-caches. now a newly compiled template gets the current time as timestamp. --- NEWS | 2 ++ libs/Smarty.class.php | 3 +-- libs/core/core.write_compiled_include.php | 1 - libs/core/core.write_compiled_resource.php | 3 +-- libs/core/core.write_file.php | 5 ----- 5 files changed, 4 insertions(+), 10 deletions(-) diff --git a/NEWS b/NEWS index 7a5b4599..6f6fa957 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ + - remove touch() call that made the compiled-template's timestamp the + same as the source-template's one. (messju) - add assign attribute to html_checkboxes and html_radios (pcg, Monte) - remove non-xhtml conformant tag from mailto function diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 746e27c5..2ca61a03 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -1408,7 +1408,6 @@ class Smarty } $_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)) { @@ -1418,7 +1417,7 @@ class Smarty 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); + $_params = array('compile_path'=>$compile_path, 'compiled_content' => $_compiled_content); require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.write_compiled_resource.php'); smarty_core_write_compiled_resource($_params, $this); diff --git a/libs/core/core.write_compiled_include.php b/libs/core/core.write_compiled_include.php index 9c87cf0c..5f894fe4 100644 --- a/libs/core/core.write_compiled_include.php +++ b/libs/core/core.write_compiled_include.php @@ -10,7 +10,6 @@ * * @param string $compile_path * @param string $template_compiled - * @param integer $template_timestamp * @return boolean */ diff --git a/libs/core/core.write_compiled_resource.php b/libs/core/core.write_compiled_resource.php index c701448c..5e132ead 100644 --- a/libs/core/core.write_compiled_resource.php +++ b/libs/core/core.write_compiled_resource.php @@ -10,7 +10,6 @@ * * @param string $compile_path * @param string $compiled_content - * @param integer $resource_timestamp * @return true */ function smarty_core_write_compiled_resource($params, &$smarty) @@ -25,7 +24,7 @@ function smarty_core_write_compiled_resource($params, &$smarty) return false; } - $_params = array('filename' => $params['compile_path'], 'timestamp'=>$params['resource_timestamp'], 'contents' => $params['compiled_content'], 'create_dirs' => true); + $_params = array('filename' => $params['compile_path'], 'contents' => $params['compiled_content'], 'create_dirs' => true); require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.write_file.php'); smarty_core_write_file($_params, $smarty); return true; diff --git a/libs/core/core.write_file.php b/libs/core/core.write_file.php index d6de7311..f889f2a1 100644 --- a/libs/core/core.write_file.php +++ b/libs/core/core.write_file.php @@ -33,11 +33,6 @@ function smarty_core_write_file($params, &$smarty) } fwrite($fd, $params['contents']); - - // Set the file's mtime - if (isset($params['timestamp'])) { - touch($_tmp_file, $params['timestamp']); - } fclose($fd); // Delete the file if it allready exists (this is needed on Win,