From 067b6b50734762efc56a0d3c7f9f9199932bf85c Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 5 Sep 2009 14:21:26 -0700 Subject: [PATCH] Installer cleanup. We no longer need the install() function for installs that only set the module version number. Same for upgrade(). Do a general cleanup of all installers and remove the ones that are no longer necessary. --- modules/basket/helpers/basket_installer.php | 17 +++------- .../batchtag/helpers/batchtag_installer.php | 27 ---------------- .../helpers/contactowner_installer.php | 23 -------------- .../developer/helpers/developer_installer.php | 31 ------------------- .../helpers/displaytags_installer.php | 27 ---------------- .../helpers/downloadfullsize_installer.php | 23 -------------- modules/dynamic/helpers/dynamic_installer.php | 4 --- .../helpers/editcreation_installer.php | 27 ---------------- .../helpers/embedlinks_installer.php | 24 -------------- modules/gmaps/helpers/gmaps_installer.php | 24 -------------- .../helpers/itemchecksum_installer.php | 27 ---------------- .../helpers/keeporiginal_installer.php | 4 --- .../helpers/latestupdates_installer.php | 31 ------------------- .../helpers/metadescription_installer.php | 24 -------------- .../helpers/minislideshow_installer.php | 8 ----- modules/nobots/helpers/nobots_installer.php | 24 -------------- .../phpmailer/helpers/phpmailer_installer.php | 27 ---------------- .../helpers/polar_rose_installer.php | 24 -------------- .../purifier/helpers/purifier_installer.php | 23 -------------- modules/rescue/helpers/rescue_installer.php | 24 -------------- modules/tagsmap/helpers/tagsmap_installer.php | 1 - .../helpers/user_homes_installer.php | 9 +----- .../helpers/videodimensions_installer.php | 27 ---------------- 23 files changed, 5 insertions(+), 475 deletions(-) delete mode 100644 modules/batchtag/helpers/batchtag_installer.php delete mode 100644 modules/contactowner/helpers/contactowner_installer.php delete mode 100644 modules/developer/helpers/developer_installer.php delete mode 100644 modules/displaytags/helpers/displaytags_installer.php delete mode 100644 modules/downloadfullsize/helpers/downloadfullsize_installer.php delete mode 100644 modules/editcreation/helpers/editcreation_installer.php delete mode 100644 modules/embedlinks/helpers/embedlinks_installer.php delete mode 100644 modules/gmaps/helpers/gmaps_installer.php delete mode 100644 modules/itemchecksum/helpers/itemchecksum_installer.php delete mode 100644 modules/latestupdates/helpers/latestupdates_installer.php delete mode 100644 modules/metadescription/helpers/metadescription_installer.php delete mode 100644 modules/nobots/helpers/nobots_installer.php delete mode 100644 modules/phpmailer/helpers/phpmailer_installer.php delete mode 100644 modules/polar_rose/helpers/polar_rose_installer.php delete mode 100644 modules/purifier/helpers/purifier_installer.php delete mode 100644 modules/rescue/helpers/rescue_installer.php delete mode 100644 modules/videodimensions/helpers/videodimensions_installer.php diff --git a/modules/basket/helpers/basket_installer.php b/modules/basket/helpers/basket_installer.php index dca5da90..1ec5edb4 100644 --- a/modules/basket/helpers/basket_installer.php +++ b/modules/basket/helpers/basket_installer.php @@ -17,16 +17,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ - -class basket_installer -{ - static function install(){ - module::set_version("basket", 1); - } - static function activate() { - +class basket_installer { + static function install() { $db = Database::instance(); - $db->query("CREATE TABLE IF NOT EXISTS {products} ( `id` int(9) NOT NULL auto_increment, `name` TEXT NOT NULL, @@ -34,16 +27,14 @@ class basket_installer `description` varchar(1024), PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;"); - - - product::create("4x6",5,"4\"x6\" print"); product::create("8x10",25,"8\"x10\" print"); product::create("8x12",30,"8\"x12\" print"); + module::set_version("basket", 1); } - static function deactivate(){ + static function uninstall() { $db = Database::instance(); $db->query("DROP TABLE IF EXISTS {products}"); } diff --git a/modules/batchtag/helpers/batchtag_installer.php b/modules/batchtag/helpers/batchtag_installer.php deleted file mode 100644 index 0a24b58c..00000000 --- a/modules/batchtag/helpers/batchtag_installer.php +++ /dev/null @@ -1,27 +0,0 @@ -query("DROP TABLE IF EXISTS {tags_gpses};"); - module::delete("tagsmap"); } } diff --git a/modules/user_homes/helpers/user_homes_installer.php b/modules/user_homes/helpers/user_homes_installer.php index 0e80e6c1..1a2af803 100644 --- a/modules/user_homes/helpers/user_homes_installer.php +++ b/modules/user_homes/helpers/user_homes_installer.php @@ -20,13 +20,6 @@ class user_homes_installer { static function install() { - module::set_version("user_homes", 1); - } - - /** - * Installs the table of user homes when the module is installed. - */ - static function activate() { $db = Database::instance(); $db->query("CREATE TABLE IF NOT EXISTS {user_homes} ( `id` int(9) NOT NULL, @@ -40,7 +33,7 @@ class user_homes_installer { /** * Drops the table of user homes when the module is uninstalled. */ - static function deactivate() { + static function uninstall() { $db = Database::instance(); $db->query("DROP TABLE IF EXISTS {user_homes};"); } diff --git a/modules/videodimensions/helpers/videodimensions_installer.php b/modules/videodimensions/helpers/videodimensions_installer.php deleted file mode 100644 index 098fca08..00000000 --- a/modules/videodimensions/helpers/videodimensions_installer.php +++ /dev/null @@ -1,27 +0,0 @@ -