Source for file Registry.php
Documentation is available at Registry.php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
* This file is part of the PEAR Testing_DocTest package.
* LICENSE: This source file is subject to the MIT license that is available
* through the world-wide-web at the following URI:
* http://opensource.org/licenses/mit-license.php
* @package Testing_DocTest
* @author David JEAN LOUIS <izimobil@gmail.com>
* @copyright 2008 David JEAN LOUIS
* @license http://opensource.org/licenses/mit-license.php MIT License
* @link http://pear.php.net/package/Testing_DocTest
* @since File available since release 0.1.0
* A simple Registry that will allow Doctest components to share options and
* instances in order to achieve loose coupling.
* Testing_DocTest_Registry::singleton()->somevar = 'foo';
* var_dump(isset(Testing_DocTest_Registry::singleton()->somevar));
* echo Testing_DocTest_Registry::singleton()->somevar . "\n";
* unset(Testing_DocTest_Registry::singleton()->somevar);
* echo Testing_DocTest_Registry::singleton()->somevar;
* @package Testing_DocTest
* @author David JEAN LOUIS <izimobil@gmail.com>
* @copyright 2008 David JEAN LOUIS
* @license http://opensource.org/licenses/mit-license.php MIT License
* @version Release: 0.6.0
* @link http://pear.php.net/package/Testing_DocTest
* @since Class available since release 0.1.0
* The singleton instance.
* @var object $_instance Testing_DocTest_Registry instance
private static $_instance = null;
* The registry items array.
private $_items = array ();
* Constructor, can not be called outside this class.
* @return object an instance of Testing_DocTest_Registry
if (self ::$_instance === null ) {
self ::$_instance = new self ();
* @param string $name name of property
* @param mixed $value value of property
public function __set($name, $value)
$this->_items[$name] = $value;
* @param string $name name of property
public function __get($name)
if (isset ($this->_items[$name])) {
return $this->_items[$name];
* Overloaded for isset() function.
* @param string $name name of property
return isset ($this->_items[$name]);
* Overloaded for unset() function.
* @param string $name name of property
unset ($this->_items[$name]);
Documentation generated on Mon, 11 Mar 2019 15:52:27 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|