00001 <?php
00019
00020
00021
00022 if (!file_exists(dirname(__FILE__) . '/settings.php')) {
00023 header("Location: install.php");
00024 exit;
00025 }
00026
00032 global $START_MICROTIME;
00033 $START_MICROTIME = microtime(true);
00034
00048 global $CONFIG;
00049 if (!isset($CONFIG)) {
00050 $CONFIG = new stdClass;
00051 }
00052 $CONFIG->boot_complete = false;
00053
00054 $lib_dir = dirname(__FILE__) . '/lib/';
00055
00056
00057 $path = $lib_dir . 'elgglib.php';
00058 if (!include_once($path)) {
00059 echo "Could not load file '$path'. Please check your Elgg installation for all required files.";
00060 exit;
00061 }
00062
00063
00064 if (!include_once(dirname(__FILE__) . "/settings.php")) {
00065 $msg = 'Elgg could not load the settings file. It does not exist or there is a file permissions issue.';
00066 throw new InstallationException($msg);
00067 }
00068
00069
00070
00071 $lib_files = array(
00072 'access.php', 'actions.php', 'admin.php', 'annotations.php', 'cache.php',
00073 'calendar.php', 'configuration.php', 'cron.php', 'database.php',
00074 'entities.php', 'export.php', 'extender.php', 'filestore.php', 'group.php',
00075 'input.php', 'languages.php', 'location.php', 'mb_wrapper.php',
00076 'memcache.php', 'metadata.php', 'metastrings.php', 'navigation.php',
00077 'notification.php', 'objects.php', 'opendd.php', 'output.php',
00078 'pagehandler.php', 'pageowner.php', 'pam.php', 'plugins.php',
00079 'private_settings.php', 'relationships.php', 'river.php', 'sessions.php',
00080 'sites.php', 'statistics.php', 'system_log.php', 'tags.php',
00081 'user_settings.php', 'users.php', 'upgrade.php', 'views.php',
00082 'web_services.php', 'widgets.php', 'xml.php', 'xml-rpc.php',
00083
00084
00085 'deprecated-1.7.php', 'deprecated-1.8.php',
00086 );
00087
00088 foreach ($lib_files as $file) {
00089 $file = $lib_dir . $file;
00090 elgg_log("Loading $file...");
00091 if (!include_once($file)) {
00092 $msg = "Could not load $file";
00093 throw new InstallationException($msg);
00094 }
00095 }
00096
00097
00098
00099 elgg_trigger_event('boot', 'system');
00100
00101
00102 elgg_load_plugins();
00103
00104
00105
00106
00107 $view_type = elgg_get_viewtype();
00108 if (!elgg_is_valid_view_type($view_type)) {
00109 elgg_set_viewtype('default');
00110 }
00111
00112
00113 elgg_trigger_event('plugins_boot', 'system');
00114
00115
00116 elgg_trigger_event('init', 'system');
00117
00118 $CONFIG->boot_complete = true;
00119
00120
00121 elgg_trigger_event('ready', 'system');