diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-06-23 12:00:49 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-06-23 12:00:49 -0700 |
commit | bfca0c79030d5b8a18e41e8b80f5560ebaf6f202 (patch) | |
tree | 71568f5d924277879cf645c0190ebd7c98a80228 /modules/gallery/controllers/upgrader.php | |
parent | 342d5e118664274fb1d8329734815640f5169887 (diff) |
Refactor the install/upgrade code to be more flexible.
Add xxx_installer::upgrade($version) method so that upgrade stanzas
are separate from install stanzas. In the old code, to do an upgrade
meant that you had to re-evolve everything from the initial install
because we'd step through each version's changes. But what we really
want is for the initial install to start off in the perfect initial
state, and the upgrades to do the work behind the scenes. So now the
install() function gets things set up properly the first time, and the
upgrade() function does any work to catch you up to the latest code.
See gallery_installer.php for a good example.
Diffstat (limited to 'modules/gallery/controllers/upgrader.php')
-rw-r--r-- | modules/gallery/controllers/upgrader.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/gallery/controllers/upgrader.php b/modules/gallery/controllers/upgrader.php index 5eb96fdd..91952fa9 100644 --- a/modules/gallery/controllers/upgrader.php +++ b/modules/gallery/controllers/upgrader.php @@ -50,8 +50,8 @@ class Upgrader_Controller extends Controller { } // Upgrade gallery and user first - module::install("gallery"); - module::install("user"); + module::upgrade("gallery"); + module::upgrade("user"); // Then upgrade the rest foreach (module::available() as $id => $module) { @@ -60,7 +60,7 @@ class Upgrader_Controller extends Controller { } if ($module->active && $module->code_version != $module->version) { - module::install($id); + module::upgrade($id); } } |