From 74717c8c3ed04c5df7ca8729dae20f5660af573e Mon Sep 17 00:00:00 2001 From: marcus Date: Tue, 3 Mar 2009 12:38:01 +0000 Subject: 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 --- engine/lib/elgglib.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'engine') 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); } } } -- cgit v1.2.3