ZF-801: Zend_Auth - Implement Singleton Pattern
If we restrict Zend_Auth to providing for authenticating HTTP requests to the application, then we need only one instance of the authentication object per PHP execution space. It is best for the component design that Zend_Auth focus on supporting the generalized use case of authenticating the HTTP request against the web application. All things considered, Zend_Auth is a good candidate for implementing the Singleton pattern, since only one instance is needed per request. Of course, the one instance could bind to any of various authentication adapters included with Zend_Auth or to a custom adapter written by the user.
By implementing the Singleton pattern, there is a side benefit of inherently providing global access to the object instance.
$auth = new Zend_Auth(...);
We would have:
$auth = Zend_Auth::getInstance();