]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #1503, fixes #1474: Library files are loaded using a hard-coded list to better...
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Tue, 9 Feb 2010 22:29:17 +0000 (22:29 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Tue, 9 Feb 2010 22:29:17 +0000 (22:29 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@3927 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/lib/elgglib.php
engine/start.php

index e6da0096910016507352aebfdd471fe09e605a40..705852ac95f9626bb11ec94e64c806eca742e411 100644 (file)
@@ -1278,32 +1278,6 @@ function friendly_title($title) {
  * Library loading and handling
  */
 
-/**
- * Recursive function designed to load library files on start
- * (NB: this does not include plugins.)
- *
- * @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()) {
-       $extensions_allowed = array('.php');
-       /*if (is_file($directory) && !in_array($directory,$file_exceptions)) {
-               $file_list[] = $directory;
-       } else */
-       if ($handle = opendir($directory)) {
-               while ($file = readdir($handle)) {
-                       if (in_array(strrchr($file, '.'), $extensions_allowed) && !in_array($file,$file_exceptions)) {
-                               $file_list[] = $directory . "/" . $file;
-                               //$file_list = get_library_files($directory . "/" . $file, $file_exceptions, $file_list);
-                       }
-               }
-       }
-
-       return $file_list;
-}
-
 /**
  * Ensures that the installation has all the correct files, that PHP is configured correctly, and so on.
  * Leaves appropriate messages in the error register if not.
index 8d5d4fac5f68463d6a444b5378fd8e64803a1ffc..ff14b378b5f1df05a103deee0a0fdbf618c67575 100644 (file)
@@ -116,31 +116,32 @@ if ($sanitised = sanitised()) {
                throw new InstallationException("Elgg could not load the main Elgg database library.");
        }
 
-       /**
-        * Load the remaining libraries from /lib/ in alphabetical order,
-        * except for a few exceptions
-        */
        if (!include_once(dirname(__FILE__) . "/lib/actions.php")) {
                throw new InstallationException("Elgg could not load the Actions library");
        }
 
-       // We don't want to load or reload these files
-       $file_exceptions = array(
-               '.', '..', '.DS_Store', 'Thumbs.db', '.svn',
-               'CVS', 'cvs', 'settings.php', 'settings.example.php',
-               'languages.php', 'exceptions.php', 'elgglib.php', 'access.php',
-               'database.php', 'actions.php', 'sessions.php'
-       );
-
-       // Get the list of files to include, and alphabetically sort them
-       $files = get_library_files(dirname(__FILE__) . "/lib",$file_exceptions);
-       asort($files);
-
        // Get config
        global $CONFIG;
 
+       // load the rest of the library files from engine/lib/
+       $lib_files = array(
+               'activity.php', 'admin.php', 'annotations.php', 'api.php',
+               'cache.php', 'calendar.php', 'configuration.php', 'cron.php',
+               'entities.php', 'export.php', 'extender.php', 'filestore.php',
+               'group.php', 'input.php', 'install.php', 'location.php', 'mb_wrapper.php',
+               'memcache.php', 'metadata.php', 'metastrings.php', 'notification.php',
+               'objects.php', 'opendd.php', 'pagehandler.php', 'pageowner.php', 'pam.php',
+               'plugins.php', 'query.php', 'relationships.php', 'river2.php', 'sites.php',
+               'social.php', 'statistics.php', 'system_log.php', 'tags.php',
+               'usersettings.php', 'users.php', 'version.php', 'widgets.php', 'xml.php',
+               'xml-rpc.php'
+       );
+
+       $lib_dir = dirname(__FILE__) . '/lib/';
+
        // Include them
-       foreach($files as $file) {
+       foreach($lib_files as $file) {
+               $file = $lib_dir . $file;
                elgg_log("Loading $file...");
                if (!include_once($file)) {
                        throw new InstallationException("Could not load {$file}");