diff options
Diffstat (limited to 'system/helpers/directory_helper.php')
-rw-r--r-- | system/helpers/directory_helper.php | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/system/helpers/directory_helper.php b/system/helpers/directory_helper.php index 7d6b6770e..49dcfc8a9 100644 --- a/system/helpers/directory_helper.php +++ b/system/helpers/directory_helper.php @@ -1,4 +1,4 @@ -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +<?php /** * CodeIgniter * @@ -24,6 +24,7 @@ * @since Version 1.0 * @filesource */ +defined('BASEPATH') OR exit('No direct script access allowed'); /** * CodeIgniter Directory Helpers @@ -46,9 +47,10 @@ if ( ! function_exists('directory_map')) * representation of it. Sub-folders contained with the * directory will be mapped as well. * - * @param string path to source - * @param int depth of directories to traverse (0 = fully recursive, 1 = current dir, etc) - * @param bool whether to show hidden files + * @param string $source_dir Path to source + * @param int $directory_depth Depth of directories to traverse + * (0 = fully recursive, 1 = current dir, etc) + * @param bool $hidden Whether to show hidden files * @return array */ function directory_map($source_dir, $directory_depth = 0, $hidden = FALSE) @@ -67,9 +69,11 @@ if ( ! function_exists('directory_map')) continue; } + @is_dir($source_dir.$file) AND $file .= DIRECTORY_SEPARATOR; + if (($directory_depth < 1 OR $new_depth > 0) && @is_dir($source_dir.$file)) { - $filedata[$file] = directory_map($source_dir.$file.DIRECTORY_SEPARATOR, $new_depth, $hidden); + $filedata[$file] = directory_map($source_dir.$file, $new_depth, $hidden); } else { |