diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-04-09 13:31:59 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-04-09 13:31:59 +0000 |
commit | 8ba402da459956a29e47df6598fe778cfea0f8d3 (patch) | |
tree | a0ddc1d11ee77ad43fef9343b707c3467d0a133d /engine/lib/upgrade.php | |
parent | 983d66229e130f18e71dd13ead5b673cc5bb14cc (diff) | |
download | elgg-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/lib/upgrade.php')
-rw-r--r-- | engine/lib/upgrade.php | 24 |
1 files changed, 4 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; } } |