zendframework/zf2 — pull request #1629 by weierophinney (2012-06-26 22:35:03+00:00)
Title: Refactored Zend\Registry to remove singleton

Lots of confusion about Zend\Registry persists. While it was primarily used as a singleton registry in ZF1, it also had the ability to be used as a per-instance registry. A large number of components were using it in both capacities.

This commit aims to:

- Remove the singleton capabilities from Zend\Registry
- Remove any references to Zend\Registry that only used it in a singleton capacity
- Ensure equivalent functionality is in place when needed (doctype, placeholder/head/inline view helpers, etc.)

The commit accomplishes:

- Registry no longer has singleton capabilities
- get() now allows passing a default value
- Refactored all classes and tests using Registry
- Most simply checked registry for an object; removed such checks
- Others stored themselves inside Registry; made those implement singletons
(and gave them methods for removing singleton instances)