diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-05-26 05:28:59 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-05-26 05:28:59 +0000 |
commit | 7aed9239088b582a065da3fb63796ff66cd357c8 (patch) | |
tree | 8be9bc4faec21b20cbcc060ad5e9ca128465d09e /modules/g2_import/helpers | |
parent | 2966289b147ceae2fed79b9534840607bf38e0d8 (diff) |
Restructure the module lifecycle.
Install: <module>_installer::install() is called, any necessary tables
are created.
Activate: <module>_installer::activate() is called. Module
controllers are routable, helpers are accessible, etc. The module is
in use.
Deactivate: <module>_installer::deactivate() is called. Module code
is not accessible or routable. Module is *not* in use, but its tables
are still around.
Uninstall: <module>_installer::uninstall() is called. Module is
completely removed from the database.
Admin > Modules will install and activate modules, but will only
deactivate (will NOT uninstall modules).
Diffstat (limited to 'modules/g2_import/helpers')
-rw-r--r-- | modules/g2_import/helpers/g2_import.php | 9 | ||||
-rw-r--r-- | modules/g2_import/helpers/g2_import_installer.php | 4 |
2 files changed, 5 insertions, 8 deletions
diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php index d035e004..37efcad0 100644 --- a/modules/g2_import/helpers/g2_import.php +++ b/modules/g2_import/helpers/g2_import.php @@ -111,13 +111,13 @@ class g2_import_Core { $stats["photos"] = g2(GalleryCoreApi::fetchItemIdCount("GalleryPhotoItem")); $stats["movies"] = g2(GalleryCoreApi::fetchItemIdCount("GalleryMovieItem")); - if (g2_import::g2_module_active("comment") && module::is_installed("comment")) { + if (g2_import::g2_module_active("comment") && module::is_active("comment")) { list (, $stats["comments"]) = g2(GalleryCommentHelper::fetchAllComments($root_album_id, 1)); } else { $stats["comments"] = 0; } - if (g2_import::g2_module_active("tags") && module::is_installed("tag")) { + if (g2_import::g2_module_active("tags") && module::is_active("tag")) { $result = g2($gallery->search("SELECT COUNT(DISTINCT([TagItemMap::itemId])) FROM [TagItemMap]")) ->nextResult(); @@ -441,7 +441,7 @@ class g2_import_Core { } static function import_keywords_as_tags($keywords, $item) { - if (!module::is_installed("tag")) { + if (!module::is_active("tag")) { return; } @@ -466,7 +466,8 @@ class g2_import_Core { // Precaution: if the Gallery2 item was watermarked, or we have the Gallery3 watermark module // active then we'd have to do something a lot more sophisticated here. For now, just skip // this step in those cases. - if (module::is_installed("watermark") && module::get_var("watermark", "name")) { + // @todo we should probably use an API here, eventually. + if (module::is_active("watermark") && module::get_var("watermark", "name")) { return; } diff --git a/modules/g2_import/helpers/g2_import_installer.php b/modules/g2_import/helpers/g2_import_installer.php index 1e60a83d..2bfb7f8c 100644 --- a/modules/g2_import/helpers/g2_import_installer.php +++ b/modules/g2_import/helpers/g2_import_installer.php @@ -33,8 +33,4 @@ class g2_import_installer { module::set_version("g2_import", 1); } } - - static function uninstall() { - module::delete("g2_import"); - } } |