aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-06-15 00:29:58 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-06-15 00:29:58 +0000
commita702acb6e62c4355e52035c3888e1c20e8af8a47 (patch)
treeebf1e80b52bf85b87865fed3e270eb1d450dffa0
parent5e5e8aaad423bda213151ff9134213062e56d09e (diff)
downloadelgg-a702acb6e62c4355e52035c3888e1c20e8af8a47.tar.gz
elgg-a702acb6e62c4355e52035c3888e1c20e8af8a47.tar.bz2
Making sure to load all plugins when doing an upgrade to pull in CSS changes and allow plugins to register for the upgrade hook.
git-svn-id: http://code.elgg.org/elgg/trunk@6488 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--engine/start.php30
1 files changed, 16 insertions, 14 deletions
diff --git a/engine/start.php b/engine/start.php
index 569fd3f83..d31090427 100644
--- a/engine/start.php
+++ b/engine/start.php
@@ -41,7 +41,7 @@ foreach ($required_files as $file) {
}
// Use fallback view until sanitised
-$oldview = get_input('view');
+$oldview = get_input('view', 'default');
set_input('view', 'failsafe');
// Register the error handler
@@ -94,17 +94,10 @@ set_default_config();
// Trigger events
trigger_elgg_event('boot', 'system');
-// Load plugins
+// Check if installed
$installed = is_installed();
$db_installed = is_db_installed();
-// Load plugins, if we're not in light mode
-if (($installed) && ($db_installed) && ($sanitised)) {
- 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")
@@ -115,16 +108,23 @@ if ((!$installed || !$db_installed)
exit;
}
-// Trigger events
-if (!substr_count($_SERVER["PHP_SELF"],"install.php")
- && !substr_count($_SERVER["PHP_SELF"],"setup.php")
- && !(defined('upgrading') && upgrading == 'upgrading')) {
+// Load plugins
+if (($installed) && ($db_installed) && ($sanitised)) {
+ load_plugins();
+
+ trigger_elgg_event('plugins_boot', 'system');
+}
+
+// Trigger system init event for plugins
+if (!substr_count($_SERVER["PHP_SELF"], "install.php")
+ && !substr_count($_SERVER["PHP_SELF"], "setup.php")) {
trigger_elgg_event('init', 'system');
}
// System booted, return to normal view
set_input('view', $oldview);
+
if (empty($oldview)) {
if (empty($CONFIG->view)) {
$oldview = 'default';
@@ -133,7 +133,9 @@ if (empty($oldview)) {
}
}
-if (($installed) && ($db_installed)) {
+// Regenerate the simple cache if expired.
+// Don't do it on upgrade, because upgrade does it itself.
+if (($installed) && ($db_installed) && !(defined('upgrading') && upgrading == 'upgrading')) {
$lastupdate = datalist_get("simplecache_lastupdate_$oldview");
$lastcached = datalist_get("simplecache_lastcached_$oldview");
if ($lastupdate == 0 || $lastcached < $lastupdate) {