[prev in list] [next in list] [prev in thread] [next in thread] 

List:       smarty-cvs
Subject:    [SMARTY-CVS] cvs: smarty / NEWS  /libs/internals core.write_file.php
From:       "boots" <boots () php ! net>
Date:       2007-01-10 16:28:38
Message-ID: cvsboots1168446518 () cvsserver
[Download RAW message or body]

boots		Wed Jan 10 16:28:38 2007 UTC

  Modified files:              
    /smarty	NEWS 
    /smarty/libs/internals	core.write_file.php 
  Log:
  Better recognize Windows filesystems to reduce warnings
  
http://cvs.php.net/viewvc.cgi/smarty/NEWS?r1=1.546&r2=1.547&diff_format=u
Index: smarty/NEWS
diff -u smarty/NEWS:1.546 smarty/NEWS:1.547
--- smarty/NEWS:1.546	Wed Jan 10 16:25:23 2007
+++ smarty/NEWS	Wed Jan 10 16:28:38 2007
@@ -1,4 +1,5 @@
-- emulate %R in the date_format modifier on windows (Danilo Buerger, boots) 
+- update smarty_core_write_file() to better recognize Windows (boots)
+- emulate %R in the date_format modifier on Windows (Danilo Buerger, boots)
 
 Version 2.6.16 (Dec 1st, 2006)
 -------------------------------
http://cvs.php.net/viewvc.cgi/smarty/libs/internals/core.write_file.php?r1=1.3&r2=1.4&diff_format=u
Index: smarty/libs/internals/core.write_file.php
diff -u smarty/libs/internals/core.write_file.php:1.3 smarty/libs/internals/core.write_file.php:1.4
--- smarty/libs/internals/core.write_file.php:1.3	Wed Nov  8 19:00:46 2006
+++ smarty/libs/internals/core.write_file.php	Wed Jan 10 16:28:38 2007
@@ -15,6 +15,10 @@
  */
 function smarty_core_write_file($params, &$smarty)
 {
+    static $OS;
+    if (is_null($OS)) {
+        $OS = substr(PHP_OS,0,3);
+    }
     $_dirname = dirname($params['filename']);
 
     if ($params['create_dirs']) {
@@ -37,7 +41,7 @@
     fwrite($fd, $params['contents']);
     fclose($fd);
 
-    if (PHP_OS == 'Windows' || !@rename($_tmp_file, $params['filename'])) {
+    if ($OS == 'WIN' || !@rename($_tmp_file, $params['filename'])) {
         // On platforms and filesystems that cannot overwrite with rename() 
         // delete the file before renaming it -- because windows always suffers
         // this, it is short-circuited to avoid the initial rename() attempt



-- 
Smarty CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic