Location: PHPKode > projects > Breeze CMS - A PHP Content Manage System > libs/Ice/Registry.class.php
<?php
//registry.class.php

//寄存器变量
GLOBAL $REGISTER;

class Ice_Registry
{
    var $obj;
    
    function Ice_Registry()
    {
        //
    }
    
    function getInstance()
    {
        static $instance = false;
        
        if (false === $instance)
        {
            $instance = new Ice_Registry();
        }
        
        $instance->obj = & $GLOBALS['REGISTER'];

        return $instance;
    }
    
    function & getValues()
    {
        return $this->obj;
    }
    
    function & set($name, $object)
    {
        $this->obj[$name] =& $object;
    }
    
    function & get($name)
    {
        return $this->obj[$name];
    }
    
    function remove($name)
    {
        unset($this->obj[$name]);
        return true;
    }
}
Return current item: Breeze CMS - A PHP Content Manage System