diff options
author | Robin Sowell <robin.sowell@ellislab.com> | 2009-05-26 23:45:54 +0200 |
---|---|---|
committer | Robin Sowell <robin.sowell@ellislab.com> | 2009-05-26 23:45:54 +0200 |
commit | 96dafa84d2c6e1f7792e67d0ea0bc81c69543894 (patch) | |
tree | 59cd308b63882be5862ec5cbdb3c67cdb050b160 /system/helpers | |
parent | 03d783ba0bbee1a5f76b6ad686bbcee59a2e21fb (diff) |
Directory helper's directory_map tweaked to allow inclusion of hidden files.
Diffstat (limited to 'system/helpers')
-rw-r--r-- | system/helpers/directory_helper.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/system/helpers/directory_helper.php b/system/helpers/directory_helper.php index 5f67b126f..b1c497686 100644 --- a/system/helpers/directory_helper.php +++ b/system/helpers/directory_helper.php @@ -41,7 +41,7 @@ */ if ( ! function_exists('directory_map')) { - function directory_map($source_dir, $top_level_only = FALSE) + function directory_map($source_dir, $top_level_only = FALSE, $hidden = FALSE) { if ($fp = @opendir($source_dir)) { @@ -50,7 +50,7 @@ if ( ! function_exists('directory_map')) while (FALSE !== ($file = readdir($fp))) { - if (strncmp($file, '.', 1) == 0) + if (($hidden == FALSE && strncmp($file, '.', 1) == 0) OR ($file == '.' OR $file == '..')) { continue; } @@ -59,7 +59,7 @@ if ( ! function_exists('directory_map')) { $temp_array = array(); - $temp_array = directory_map($source_dir.$file.DIRECTORY_SEPARATOR); + $temp_array = directory_map($source_dir.$file.DIRECTORY_SEPARATOR, $top_level_only, $hidden); $filedata[$file] = $temp_array; } |