Location: PHPKode > projects > Dev's CMS > devscms/includes/class.config.php
<?php

class config
{
	private static $_instance;
	private $_config;
	private $_paths;
	
	private function __construct()
	{
		$this->_config = new stdClass();
	}
	
	public static function &createNamespace($name)
	{
		$config = &config::getConfig();
		if (!isset($config->$name)) {
			$config->$name = new stdClass();
		}
		return $config->$name;
	}
	
	public static function get($namespace, $variable)
	{
		return config::getConfig()->$namespace->$variable;
	}
	
	public static function &getConfig()
	{
		return config::getInstance()->_config;
	}
	
	public static function set($namespace, $variable, $value)
	{
		if (!isset(config::getConfig()->$namespace)) { config::getConfig()->$namespace = new stdClass(); }
		config::getConfig()->$namespace->$variable = $value;
	}
	
	/**
	* @return config
	*/
	public static function &getInstance()
	{
		if (!isset(config::$_instance)) {
			config::$_instance = new config();
		}
		
		return config::$_instance;
	}
	
}
Return current item: Dev's CMS