summaryrefslogtreecommitdiff
path: root/core/hooks
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-05-26 05:28:59 +0000
committerBharat Mediratta <bharat@menalto.com>2009-05-26 05:28:59 +0000
commit7aed9239088b582a065da3fb63796ff66cd357c8 (patch)
tree8be9bc4faec21b20cbcc060ad5e9ca128465d09e /core/hooks
parent2966289b147ceae2fed79b9534840607bf38e0d8 (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 'core/hooks')
-rw-r--r--core/hooks/init_gallery.php7
1 files changed, 5 insertions, 2 deletions
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