Next, we get a reference to the Horde Registry:
<?php
// Registry require_once HORDE_BASE . '/lib/Registry.php'; $registry = &Registry::singleton(); $registry->pushApp('nag'); $conf = &$GLOBALS['conf']; @define('NAG_TEMPLATES', $registry->getParam('templates'));
?>
- We always use the &Registry::singleton() static method as the registry
might have been instantiated by a previous application, and we
need the same application stack.
- $registry->pushApp('nag') pushes Nag as the active application, and loads configuration files and preferences if they aren't cached.
- $conf = &$GLOBALS['conf'] ensures that we have a reference to our configuration array in the current scope.
- Finally, we define a constant telling us where our templates live. This simply saves registry calls later.
|