Add extension for CI's directory helper

This commit is contained in:
Eike Foken
2011-08-19 01:41:33 +02:00
parent 20d0d2b9f5
commit 702da31f14

View File

@@ -0,0 +1,26 @@
<?php defined('BASEPATH') || exit('No direct script access allowed');
/**
* Extends CI's directory helpers.
*
* @author Eike Foken <kontakt@eikefoken.de>
*/
/**
* Creates a directory if it not already exists. Works recursively.
*
* @param string $path Path to the directory to create
* @return boolean
*/
if (!function_exists('mkdirs')) {
function mkdirs($path, $mode = 0777) {
if (!is_dir($path)) {
$old_umask = umask(0);
$result = mkdir($path, $mode, true);
umask($old_umask);
}
return $result;
}
}
/* End of file MY_file_helper.php */
/* Location: ./application/helpers/MY_file_helper.php */