cleaned up structure, fixed bugs

This commit is contained in:
Logsol 2013-07-08 22:14:56 +02:00
parent 9119550d1c
commit 1979f850f9
6 changed files with 74 additions and 6 deletions

View file

@ -0,0 +1,66 @@
<?php
/**
* Katharsis Registry
* Global data pool
*
* @author Karl Pannek <info@katharsis.in>
* @version 0.5.2
* @package Katharsis
*/
class Katharsis_Registry
{
/**
* @var Katharsis_Registry
*/
protected static $_instance = null;
/**
* @var array
*/
protected $_params = array();
/**
* Singleton. Returns the same instance every time
*
* @return Katharsis_Registry
*/
public static function getInstance()
{
if(self::$_instance === null)
{
self::$_instance = new self();
}
return self::$_instance;
}
/**
* Magical get method, gets specific param
*
* @param string $name
* @return string
*/
public function __get($name)
{
if(array_key_exists($name, $this->_params))
{
return $this->_params[$name];
}
return null;
}
/**
* Magical set method, sets specific param
*
* @param string name
* @param string value
*/
public function __set($name, $value)
{
$this->_params[$name] = $value;
}
public function getAll()
{
return $this->_params;
}
}