- fixed spelling, PHPDoc , minor errors, code cleanup

This commit is contained in:
Uwe.Tews@googlemail.com
2014-06-06 02:40:04 +00:00
parent ca6a908c83
commit 425091a19f
130 changed files with 6618 additions and 4898 deletions
+10 -13
View File
@@ -2,15 +2,15 @@
/**
* Smarty write file plugin
*
* @package Smarty
* @package Smarty
* @subpackage PluginsInternal
* @author Monte Ohrt
* @author Monte Ohrt
*/
/**
* Smarty Internal Write File Class
*
* @package Smarty
* @package Smarty
* @subpackage PluginsInternal
*/
class Smarty_Internal_Write_File
@@ -18,9 +18,11 @@ class Smarty_Internal_Write_File
/**
* Writes file in a safe way to disk
*
* @param string $_filepath complete filepath
* @param string $_contents file content
* @param Smarty $smarty smarty instance
* @param string $_filepath complete filepath
* @param string $_contents file content
* @param Smarty $smarty smarty instance
*
* @throws SmartyException
* @return boolean true
*/
public static function writeFile($_filepath, $_contents, Smarty $smarty)
@@ -38,13 +40,11 @@ class Smarty_Internal_Write_File
}
// write to tmp file, then move to overt file lock race condition
$_tmp_file = $_dirpath . DS . str_replace(array('.',','), '_', uniqid('wrt', true));
$_tmp_file = $_dirpath . DS . str_replace(array('.', ','), '_', uniqid('wrt', true));
if (!file_put_contents($_tmp_file, $_contents)) {
error_reporting($_error_reporting);
throw new SmartyException("unable to write file {$_tmp_file}");
return false;
}
}
/*
* Windows' rename() fails if the destination exists,
@@ -72,8 +72,6 @@ class Smarty_Internal_Write_File
if (!$success) {
error_reporting($_error_reporting);
throw new SmartyException("unable to write file {$_filepath}");
return false;
}
if ($smarty->_file_perms !== null) {
@@ -85,5 +83,4 @@ class Smarty_Internal_Write_File
return true;
}
}