aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/elgglib.php
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-02-12 10:49:45 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-02-12 10:49:45 +0000
commit4be0a2ac1c8e959945cfaffed4e1ad59bfdad5ec (patch)
tree0f8da40c70d7518e91f639ad6622376a08a85311 /engine/lib/elgglib.php
parent398dfbd30d5b4974ccc8df71ae34795e86ffff38 (diff)
downloadelgg-4be0a2ac1c8e959945cfaffed4e1ad59bfdad5ec.tar.gz
elgg-4be0a2ac1c8e959945cfaffed4e1ad59bfdad5ec.tar.bz2
The engine starter now functions appropriately
git-svn-id: https://code.elgg.org/elgg/trunk@5 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/elgglib.php')
-rw-r--r--engine/lib/elgglib.php43
1 files changed, 43 insertions, 0 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php
new file mode 100644
index 000000000..dce99d0a4
--- /dev/null
+++ b/engine/lib/elgglib.php
@@ -0,0 +1,43 @@
+<?php
+
+ /**
+ * Elgg library
+ * Contains important functionality core to Elgg
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.org/
+ */
+
+ /**
+ * Loading libraries **************************************************************************
+ */
+
+ /**
+ * Recursive function designed to load library files on start
+ *
+ * @param string $directory Full path to the directory to start with
+ * @param string $file_exceptions A list of filenames (with no paths) you don't ever want to include
+ * @param string $file_list A list of files that you know already you want to include
+ * @return array Array of full filenames
+ */
+ function get_library_files($directory, $file_exceptions = array(), $file_list = array()) {
+
+ if (is_file($directory)) {
+ $file_list[] = $directory;
+ } else if ($handle = opendir($directory)) {
+ while ($file = readdir($handle)) {
+ if (!in_array($file,$file_exceptions)) {
+ $file_list = get_library_files($directory . "/" . $file, $file_exceptions, $file_list);
+ }
+ }
+ }
+
+ return $file_list;
+
+ }
+
+?> \ No newline at end of file