added ability to "extend" helpers
* modified Loader to check for prefixed helpers in application/helpers folder
* surrounded provided helper functions with if (! function_exists('foo')) conditionals so the user's helper functions take precedent.
diff --git a/system/helpers/directory_helper.php b/system/helpers/directory_helper.php
index 4a499de..5a23944 100644
--- a/system/helpers/directory_helper.php
+++ b/system/helpers/directory_helper.php
@@ -39,29 +39,31 @@
* @param bool whether to limit the result to the top level only
* @return array
*/
-function directory_map($source_dir, $top_level_only = FALSE)
-{
- if ($fp = @opendir($source_dir))
- {
- $filedata = array();
- while (FALSE !== ($file = readdir($fp)))
+if (! function_exists('directory_map'))
+{
+ function directory_map($source_dir, $top_level_only = FALSE)
+ {
+ if ($fp = @opendir($source_dir))
{
- if (@is_dir($source_dir.$file) && substr($file, 0, 1) != '.' AND $top_level_only == FALSE)
+ $filedata = array();
+ while (FALSE !== ($file = readdir($fp)))
{
- $temp_array = array();
+ if (@is_dir($source_dir.$file) && substr($file, 0, 1) != '.' AND $top_level_only == FALSE)
+ {
+ $temp_array = array();
- $temp_array = directory_map($source_dir.$file."/");
+ $temp_array = directory_map($source_dir.$file."/");
- $filedata[$file] = $temp_array;
+ $filedata[$file] = $temp_array;
+ }
+ elseif (substr($file, 0, 1) != ".")
+ {
+ $filedata[] = $file;
+ }
}
- elseif (substr($file, 0, 1) != ".")
- {
- $filedata[] = $file;
- }
+ return $filedata;
}
- return $filedata;
}
}
-
?>
\ No newline at end of file