From 7aed9239088b582a065da3fb63796ff66cd357c8 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 26 May 2009 05:28:59 +0000 Subject: Restructure the module lifecycle. Install: _installer::install() is called, any necessary tables are created. Activate: _installer::activate() is called. Module controllers are routable, helpers are accessible, etc. The module is in use. Deactivate: _installer::deactivate() is called. Module code is not accessible or routable. Module is *not* in use, but its tables are still around. Uninstall: _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). --- core/hooks/init_gallery.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'core/hooks') diff --git a/core/hooks/init_gallery.php b/core/hooks/init_gallery.php index ce32fcfc..2c36795a 100644 --- a/core/hooks/init_gallery.php +++ b/core/hooks/init_gallery.php @@ -18,16 +18,19 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ +// If var/database.php doesn't exist, then we assume that the Gallery is not properly installed +// and send users to the installer. if (!file_exists(VARPATH . "database.php")) { url::redirect(url::abs_file("installer")); } Event::add("system.ready", array("I18n", "instance")); -Event::add("system.post_routing", array("theme", "load_themes")); Event::add("system.ready", array("module", "load_modules")); +Event::add("system.ready", array("core", "ready")); +Event::add("system.post_routing", array("theme", "load_themes")); Event::add("system.post_routing", array("url", "parse_url")); -Event::add("system.shutdown", array("module", "shutdown")); Event::add("system.post_routing", array("core", "maintenance_mode")); +Event::add("system.shutdown", array("core", "shutdown")); // Override the cookie if we have a session id in the URL. // @todo This should probably be an event callback -- cgit v1.2.3