aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-04-09 13:31:59 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-04-09 13:31:59 +0000
commit8ba402da459956a29e47df6598fe778cfea0f8d3 (patch)
treea0ddc1d11ee77ad43fef9343b707c3467d0a133d /engine
parent983d66229e130f18e71dd13ead5b673cc5bb14cc (diff)
downloadelgg-8ba402da459956a29e47df6598fe778cfea0f8d3.tar.gz
elgg-8ba402da459956a29e47df6598fe778cfea0f8d3.tar.bz2
Refs #3241 cleaned up upgrade sequence so that we don't need special catch for that one upgrade created during 1.7 development. It doesn't hurt running it twice so sites currently using svn trunk will not be negatively affected.
git-svn-id: http://code.elgg.org/elgg/trunk@8964 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine')
-rw-r--r--engine/lib/upgrade.php24
-rw-r--r--engine/lib/upgrades/2011021800-1.8_svn-goodbye_walled_garden-083121a656d06894.php (renamed from engine/lib/upgrades/2010050701.php)3
2 files changed, 7 insertions, 20 deletions
diff --git a/engine/lib/upgrade.php b/engine/lib/upgrade.php
index 159da5da8..755c100dd 100644
--- a/engine/lib/upgrade.php
+++ b/engine/lib/upgrade.php
@@ -36,32 +36,16 @@ function upgrade_code($version, $quiet = FALSE) {
return false;
}
- // bootstrap into the new upgrade system.
- // can't do this in an upgrade because we need to check for 2010050701,
- // which would already have been run by then.
+ // if before the new upgrade system, run through all upgrades and check
+ // version number. After the upgrade epoch, pull run upgrades from db
if ($version < $upgrade_epoch) {
foreach ($upgrade_files as $upgrade_file) {
$upgrade_version = elgg_get_upgrade_file_version($upgrade_file);
- // the upgrade that made life difficult
- // the only way to test if we're upgrading from 1.7 to 1.8 or within 1.8
- // is to test for the the walled_garden config option, which
- // 2010050701 explicitly sets
- if ($upgrade_version == 2010050701) {
- $db_prefix = elgg_get_config('dbprefix');
- $site_guid = elgg_get_config('site_guid');
- $q = "SELECT value FROM {$db_prefix}config
- WHERE name = 'walled_garden' AND site_guid = {$site_guid}";
- $result = get_data_row($q);
- if (!$result) {
- $upgrades[] = $upgrade_file;
- }
-
- continue;
- } elseif ($version < $upgrade_version) {
+ if ($version < $upgrade_version) {
$upgrades[] = $upgrade_file;
} else {
- // all of the upgrades before the epoch have been run except one...
+ // set this upgrade as processed so that we don't run it again
$processed_upgrades[] = $upgrade_file;
}
}
diff --git a/engine/lib/upgrades/2010050701.php b/engine/lib/upgrades/2011021800-1.8_svn-goodbye_walled_garden-083121a656d06894.php
index b92d6a668..5f98ef535 100644
--- a/engine/lib/upgrades/2010050701.php
+++ b/engine/lib/upgrades/2011021800-1.8_svn-goodbye_walled_garden-083121a656d06894.php
@@ -1,5 +1,8 @@
<?php
/**
+ * Elgg 1.8-svn upgrade 2011021800
+ * goodbye_walled_garden
+ *
* Removes the Walled Garden plugin in favor of new system settings
*/