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.
The '&' is important to make sure that the object isn't copied:
<?php $registry = &Registry::singleton(); ?>
All applications should put themselves onto the application stack
when they start running. This also takes care of a number of things:
if this is the first application, then the session is started and
language selection is run. The application's configuration and
locale files are loaded, and if a user is logged in, their
preferences are loaded:
<?php $registry->pushApp('curapp'); ?>
|