X-Git-Url: http://git.harvie.cz/?a=blobdiff_plain;f=inc%2Fsmarty%2Fcore%2Fcore.write_file.php;fp=inc%2Fsmarty%2Fcore%2Fcore.write_file.php;h=0000000000000000000000000000000000000000;hb=b42b2bf946332ad8544d53f610be9cb05e80bf56;hp=c92454d4e816f17eeed7a19ecb666ffd0cacd0d4;hpb=e586807dafc64c3fe152ab518599e6cf3f0f84e1;p=mirrors%2FKyberia-bloodline.git diff --git a/inc/smarty/core/core.write_file.php b/inc/smarty/core/core.write_file.php deleted file mode 100644 index c92454d..0000000 --- a/inc/smarty/core/core.write_file.php +++ /dev/null @@ -1,48 +0,0 @@ - $_dirname); - require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.create_dir_structure.php'); - smarty_core_create_dir_structure($_params, $smarty); - } - - // write to tmp file, then rename it to avoid - // file locking race condition - $_tmp_file = $_dirname . DIRECTORY_SEPARATOR . uniqid(''); - - if (!($fd = @fopen($_tmp_file, 'w'))) { - $smarty->trigger_error("problem writing temporary file '$_tmp_file'"); - return false; - } - - fwrite($fd, $params['contents']); - fclose($fd); - if(file_exists($params['filename'])) { - @unlink($params['filename']); - } - @rename($_tmp_file, $params['filename']); - @chmod($params['filename'], $smarty->_file_perms); - - return true; -} - -/* vim: set expandtab: */ - -?>