aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-03-03 12:38:01 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-03-03 12:38:01 +0000
commit74717c8c3ed04c5df7ca8729dae20f5660af573e (patch)
tree3f489cc9b509bddb2b131b319359beb1c4dbf570 /engine
parentbb04c9c62d2f55e7cef382955893fba934265618 (diff)
downloadelgg-74717c8c3ed04c5df7ca8729dae20f5660af573e.tar.gz
elgg-74717c8c3ed04c5df7ca8729dae20f5660af573e.tar.bz2
Made get_library_files non-recursive and removed is_dir test... makes the func <1% of total execution time
git-svn-id: https://code.elgg.org/elgg/trunk@3029 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine')
-rw-r--r--engine/lib/elgglib.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php
index 5571339cd..8be1ec226 100644
--- a/engine/lib/elgglib.php
+++ b/engine/lib/elgglib.php
@@ -1158,12 +1158,14 @@
*/
function get_library_files($directory, $file_exceptions = array(), $file_list = array()) {
$extensions_allowed = array('.php');
- if (is_file($directory) && !in_array($directory,$file_exceptions)) {
+ /*if (is_file($directory) && !in_array($directory,$file_exceptions)) {
$file_list[] = $directory;
- } else if ($handle = opendir($directory)) {
+ } else */
+ if ($handle = opendir($directory)) {
while ($file = readdir($handle)) {
if (in_array(strrchr($file, '.'), $extensions_allowed) && !in_array($file,$file_exceptions)) {
- $file_list = get_library_files($directory . "/" . $file, $file_exceptions, $file_list);
+ $file_list[] = $directory . "/" . $file;
+ //$file_list = get_library_files($directory . "/" . $file, $file_exceptions, $file_list);
}
}
}