cvs: smarty / NEWS /libs/internals core.write_file.php

From: Date: Wed, 10 Jan 2007 16:28:38 +0000
Subject: cvs: smarty / NEWS /libs/internals core.write_file.php
Groups: php.smarty.cvs 
Request: Send a blank email to php-smarty-cvs+get-2192@lists.php.net to get a copy of this message
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

« previous php.smarty.cvs (#2192) next »