View file core/autoload/Registry.class.php

File size: 946B
<?
/*
 Кредитор ,Искатель ,Djkohade
*/
class Registry {

     static private $_instance = null;
     private $_registry = array();

     static public function getInstance() {
          if (is_null(self::$_instance)) { 
				self::$_instance = new self; 
          } 
		  return self::$_instance; 
     }
	 
     // запись переменной
     static public function set($key, $object) { 
		self::getInstance()->_registry[$key] = $object; 
     }

     // получение записанной переменной
     static public function get($key) {
		return self::getInstance()->_registry[$key]; 
     }
	
     // удаление записанной переменной
     static function remove($key) {
		unset(self::getInstance()->_registry[$key]);
     }
	 
     private function __wakeup() {} 
     private function __construct() {}
     private function __clone() {}
}