/** * Returns TRUE if the $index is a named value in the registry, * or FALSE if $index was not found in the registry. * * @param string $index * @return boolean */ public static function isRegistered($index) { if (self::$_registry === null) { return false; } return self::$_registry->offsetExists($index); }
/** * * @param string $className * @return Miao_Form_Controller */ protected static function _getInstance($className) { $index = 'frm::' . $className; if (!Miao_Registry::isRegistered($index)) { $instance = new $className(); Miao_Registry::set($index, $instance); } return $instance; }
/** * * * Enter description here ... * * @throws Miao_Path_Exception * @return Miao_Path */ public static function getDefaultInstance() { $index = self::$_defaultindex; if (!Miao_Registry::isRegistered($index)) { throw new Miao_Path_Exception('Default instance does\'t register.'); } $result = Miao_Registry::get($index); return $result; }
protected static function _getInstance($className) { $index = 'dh:' . $className; if (Miao_Registry::isRegistered($index)) { $result = Miao_Registry::get($index); } else { $result = new $className(); Miao_Registry::set($index, $result); } return $result; }
private static function _getDefaultInstance() { $index = 'Miao_Config::default'; if (!Miao_Registry::isRegistered($index)) { $result = new self(); Miao_Registry::set($index, $result); } else { $result = Miao_Registry::get($index); } return $result; }
protected static function _getInstance($className) { $index = 'dh:jscsslist:' . $className; $result = null; if (!Miao_Registry::isRegistered($index)) { $result = new $className(); if (!$result instanceof Miao_Office_DataHelper_Url) { throw new Miao_Office_DataHelper_Url_Exception(sprintf('Invalid class %s: must be instance of Miao_Office_DataHelper_Url', $className)); } if (!$result instanceof Miao_Office_DataHelper_Url_Interface) { throw new Miao_Office_DataHelper_Url_Exception(sprintf('Invalid class %s: must be implement of Miao_Office_DataHelper_Url_Interface', $className)); } Miao_Registry::set($index, $result); } else { $result = Miao_Registry::get($index); } return $result; }
public function testDefaultRegistryArrayAsPropsZF4654() { $registry = Miao_Registry::getInstance(); $registry->bar = "baz"; $this->assertEquals('baz', Miao_Registry::get('bar')); }