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.
This commit is contained in:
messju
2004-07-12 15:05:30 +00:00
parent a8fc9c3591
commit 08ff67c5ba
5 changed files with 4 additions and 10 deletions

2
NEWS
View File

@@ -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

View File

@@ -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);

View File

@@ -10,7 +10,6 @@
*
* @param string $compile_path
* @param string $template_compiled
* @param integer $template_timestamp
* @return boolean
*/

View File

@@ -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;

View File

@@ -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,