reverting tinymce changes, updating smarty to 3.1.19

This commit is contained in:
hauke 2014-09-07 13:38:28 +02:00
parent 5633e88aad
commit 0e1f8f6486
155 changed files with 13663 additions and 10784 deletions

View file

@ -2,25 +2,27 @@
/**
* 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 {
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,17 +40,16 @@ class Smarty_Internal_Write_File {
}
// write to tmp file, then move to overt file lock race condition
$_tmp_file = $_dirpath . DS . 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,
* Linux' rename() properly handles the overwrite.
* Simply unlink()ing a file might cause other processes
* Simply unlink()ing a file might cause other processes
* currently reading that file to fail, but linux' rename()
* seems to be smart enough to handle that for us.
*/
@ -71,7 +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) {
@ -80,9 +80,7 @@ class Smarty_Internal_Write_File {
umask($old_umask);
}
error_reporting($_error_reporting);
return true;
}
}
?>