removed mods directory from the ATutor codebase
[atutor.git] / mods / phpdoc2 / PhpDocumentor / phpDocumentor / Smarty-2.6.0 / libs / core / core.write_file.php
diff --git a/mods/phpdoc2/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/core/core.write_file.php b/mods/phpdoc2/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/core/core.write_file.php
deleted file mode 100644 (file)
index 534a382..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-<?php\r
-/**\r
- * Smarty plugin\r
- * @package Smarty\r
- * @subpackage plugins\r
- */\r
-\r
-/**\r
- * write out a file to disk\r
- *\r
- * @param string $filename\r
- * @param string $contents\r
- * @param boolean $create_dirs\r
- * @return boolean\r
- */\r
-function smarty_core_write_file($params, &$smarty)\r
-{\r
-    $_dirname = dirname($params['filename']);\r
-\r
-    if ($params['create_dirs']) {\r
-        $_params = array('dir' => $_dirname);\r
-        require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.create_dir_structure.php');\r
-        smarty_core_create_dir_structure($_params, $smarty);\r
-    }\r
-\r
-    // write to tmp file, then rename it to avoid\r
-    // file locking race condition\r
-    $_tmp_file = $_dirname . DIRECTORY_SEPARATOR . uniqid('');\r
-\r
-    if (!($fd = @fopen($_tmp_file, 'w'))) {\r
-        $smarty->trigger_error("problem writing temporary file '$_tmp_file'");\r
-        return false;\r
-    }\r
-\r
-    fwrite($fd, $params['contents']);\r
-    fclose($fd);\r
-    if(file_exists($params['filename'])) {\r
-        @unlink($params['filename']);\r
-    }\r
-    @rename($_tmp_file, $params['filename']);\r
-    @chmod($params['filename'], $smarty->_file_perms);\r
-\r
-    return true;\r
-}\r
-\r
-/* vim: set expandtab: */\r
-\r
-?>\r