From bfca0c79030d5b8a18e41e8b80f5560ebaf6f202 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 23 Jun 2009 12:00:49 -0700 Subject: 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. --- modules/slideshow/helpers/slideshow_installer.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'modules/slideshow') diff --git a/modules/slideshow/helpers/slideshow_installer.php b/modules/slideshow/helpers/slideshow_installer.php index b46f5471..cd1c6e05 100644 --- a/modules/slideshow/helpers/slideshow_installer.php +++ b/modules/slideshow/helpers/slideshow_installer.php @@ -19,10 +19,7 @@ */ class slideshow_installer { static function install() { - $version = module::get_version("slideshow"); - if ($version == 0) { - module::set_version("slideshow", 1); - } + module::set_version("slideshow", 1); } static function deactivate() { -- cgit v1.2.3