cvs: smarty /libs/core core.write_compiled_resource.php core.write_file.php

"Messju Mohr" <[email protected]>
Newsgroups gmane.comp.php.cvs.smarty
Message-ID <cvsmessju1069576663@cvsserver>
messju		Sun Nov 23 03:37:43 2003 EDT

  Modified files:              
    /smarty/libs/core	core.write_file.php 
                     	core.write_compiled_resource.php 
  Log:
  avoid touch()-ing of recently unlinked files by touch()-ing the
  tempfile before rename instead of touch()-ing the resulting file after
  rename.
  
  
  
Index: smarty/libs/core/core.write_file.php
diff -u smarty/libs/core/core.write_file.php:1.7 smarty/libs/core/core.write_file.php:1.8
--- smarty/libs/core/core.write_file.php:1.7	Sat Oct 11 04:55:53 2003
+++ smarty/libs/core/core.write_file.php	Sun Nov 23 03:37:43 2003
@@ -33,6 +33,9 @@
     }
 
     fwrite($fd, $params['contents']);
+    if (isset($params['timestamp'])) {
+       touch($_tmp_file, $params['timestamp']);
+    }
     fclose($fd);
     if(file_exists($params['filename'])) {
         @unlink($params['filename']);
Index: smarty/libs/core/core.write_compiled_resource.php
diff -u smarty/libs/core/core.write_compiled_resource.php:1.4 smarty/libs/core/core.write_compiled_resource.php:1.5
--- smarty/libs/core/core.write_compiled_resource.php:1.4	Sat Oct 11 04:55:53 2003
+++ smarty/libs/core/core.write_compiled_resource.php	Sun Nov 23 03:37:43 2003
@@ -25,10 +25,9 @@
         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;
 }
 

-- 
Smarty CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.