Skip to content

Latest commit

 

History

History
47 lines (33 loc) · 975 Bytes

README.rst

File metadata and controls

47 lines (33 loc) · 975 Bytes

Purpose

To implement a central storage for objects often used throughout the application, is typically implemented using an abstract class with only static methods (or using the Singleton pattern)

Examples

  • Zend Framework 1: Zend_Registry holds the application's logger object, front controller etc.
  • Yii Framework: CWebApplication holds all the application components, such as CWebUser, CUrlManager, etc.

UML Diagram

Alt Registry UML Diagram

Code

You can also find these code on GitHub

Registry.php

.. literalinclude:: Registry.php
   :language: php
   :linenos:

Test

Tests/RegistryTest.php

.. literalinclude:: Tests/RegistryTest.php
   :language: php
   :linenos: