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 /core/helpers/core.php | |
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 'core/helpers/core.php')
-rw-r--r-- | core/helpers/core.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/core/helpers/core.php b/core/helpers/core.php index 5023bb15..63f51f86 100644 --- a/core/helpers/core.php +++ b/core/helpers/core.php @@ -18,6 +18,10 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class core_Core { + /** + * If Gallery is in maintenance mode, then force all non-admins to get routed to a "This site is + * down for maintenance" page. + */ static function maintenance_mode() { $maintenance_mode = Kohana::config("core.maintenance_mode", false, false); @@ -27,4 +31,22 @@ class core_Core { Router::$method = "index"; } } + + /** + * This function is called when the Gallery is fully initialized. We relay it to modules as the + * "gallery_ready" event. Any module that wants to perform an action at the start of every + * request should implement the <module>_event::gallery_ready() handler. + */ + static function ready() { + module::event("gallery_ready"); + } + + /** + * This function is called right before the Kohana framework shuts down. We relay it to modules + * as the "gallery_shutdown" event. Any module that wants to perform an action at the start of + * every request should implement the <module>_event::gallery_shutdown() handler. + */ + static function shutdown() { + module::event("gallery_shutdown"); + } }
\ No newline at end of file |