Horde's Registry is the glue that holds different applications together
<?php
require_once HORDE_BASE . '/lib/Registry.php';
// The Registry has a singleton method that should be used to ensure // that there is only ever one instance of the Registry during a request. $registry = &Registry::singleton();
// All applications should put themselves on the application stack when they start running // This also takes care of reading the application's configuration file. $registry->pushApp('curapp');
// When an app is finished, pop it off the application stack // This also returns the global $conf variable to that of the previous application. $registry->popApp();
// Routines can determine the current app: $curapp = $registry->getApp();
// Find out if the current application allows guests if ($registry->allowGuests()) { // Guest access allowed // allowGuests() checks the current app, if one is not specified }
?>
- The Registry system keeps track of Horde's application stack, and which app is currently running.
- When you switch applications, the registry will take care of switching the gettext textdomain correctly.
- It also lets you determine configuration information about installed applications, such as whether they allow guest users.
|