diff --git a/application/helpers/MY_directory_helper.php b/application/helpers/MY_directory_helper.php new file mode 100644 index 0000000..a476283 --- /dev/null +++ b/application/helpers/MY_directory_helper.php @@ -0,0 +1,26 @@ + + */ + +/** + * 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 */