debug) && $CONFIG->debug) error_log("Loading $file..."); if (!include_once($file)) throw new InstallationException("Could not load {$file}"); } } else { // End portion for sanitised installs only throw new InstallationException(elgg_echo('installation:error:configuration')); } // Autodetect some default configuration settings set_default_config(); // Trigger events trigger_elgg_event('boot', 'system'); // Load plugins $installed = is_installed(); $db_installed = is_db_installed(); // Determine light mode $lm = strtolower(get_input('lightmode')); if ($lm == 'true') $lightmode = true; // Load plugins, if we're not in light mode if (($installed) && ($db_installed) && ($sanitised) && (!$lightmode)) { load_plugins(); trigger_elgg_event('plugins_boot', 'system'); } // Forward if we haven't been installed if ((!$installed || !$db_installed) && !substr_count($_SERVER["PHP_SELF"],"install.php") && !substr_count($_SERVER["PHP_SELF"],"css.php") && !substr_count($_SERVER["PHP_SELF"],"action_handler.php")) { header("Location: install.php"); exit; } // Trigger events if (!substr_count($_SERVER["PHP_SELF"],"install.php") && !substr_count($_SERVER["PHP_SELF"],"setup.php") && !$lightmode && !(defined('upgrading') && upgrading == 'upgrading')) { // If default settings haven't been installed, forward to the default settings page trigger_elgg_event('init', 'system'); //if (!datalist_get('default_settings')) { //forward("setup.php"); //} } // System booted, return to normal view set_input('view', $oldview); if (empty($oldview)) { if (empty($CONFIG->view)) $oldview = 'default'; else $oldview = $CONFIG->view; } if (($installed) && ($db_installed)) { $lastupdate = datalist_get('simplecache_lastupdate'); $lastcached = datalist_get('simplecache_'.$oldview); if ($lastupdate == 0 || $lastcached < $lastupdate) { elgg_view_regenerate_simplecache(); $lastcached = time(); datalist_set('simplecache_lastupdate',$lastcached); datalist_set('simplecache_'.$oldview,$lastcached); } $CONFIG->lastcache = $lastcached; } ?>