PEAR_Config::getRegistry PHP Method

getRegistry() public method

public getRegistry ( $use = null ) : PEAR_Registry
return PEAR_Registry
    function &getRegistry($use = null)
    {
        $layer = $use === null ? 'user' : $use;
        if (isset($this->_registry[$layer])) {
            return $this->_registry[$layer];
        } elseif ($use === null && isset($this->_registry['system'])) {
            return $this->_registry['system'];
        } elseif ($use === null && isset($this->_registry['default'])) {
            return $this->_registry['default'];
        } elseif ($use) {
            $a = false;
            return $a;
        }
        // only go here if null was passed in
        echo "CRITICAL ERROR: Registry could not be initialized from any value";
        exit(1);
    }

Usage Example

Beispiel #1
0
 /**
  * @param PEAR_Config
  */
 function PEAR_Downloader_Package(&$downloader)
 {
     $this->_downloader =& $downloader;
     $this->_config =& $this->_downloader->config;
     $this->_registry =& $this->_config->getRegistry();
     $this->_valid = $this->_analyzed = false;
 }
All Usage Examples Of PEAR_Config::getRegistry