Directory helper's directory_map tweaked to allow inclusion of hidden files.
diff --git a/system/helpers/directory_helper.php b/system/helpers/directory_helper.php
index 5f67b12..b1c4976 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 @@
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 @@
{
$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;
}