Memcache caching, #18
git-svn-id: svn+ssh://code.netmonsters.ru/svn/majestic/branches/evo@120 4cb57b5f-5bbd-dd11-951b-001d605cbbc5
This commit is contained in:
10
Config.php
10
Config.php
@ -26,17 +26,17 @@ class Config extends ArrayObject
|
||||
*/
|
||||
static public function getInstance()
|
||||
{
|
||||
if (! isset(self::$_instance)) {
|
||||
if (!isset(self::$_instance)) {
|
||||
self::$_instance = new Config();
|
||||
}
|
||||
return self::$_instance;
|
||||
}
|
||||
|
||||
static public function get($name)
|
||||
static public function get($name, $default = null)
|
||||
{
|
||||
$instance = self::getInstance();
|
||||
if (! $instance->offsetExists($name)) {
|
||||
throw new Exception('Configuration variable "' . $name . '" undefined');
|
||||
if (!$instance->offsetExists($name)) {
|
||||
return $default;
|
||||
}
|
||||
return $instance->offsetGet($name);
|
||||
}
|
||||
@ -59,7 +59,7 @@ class ConfigArray extends ArrayObject
|
||||
|
||||
public function offsetGet($index)
|
||||
{
|
||||
if (! $this->offsetExists($index)) {
|
||||
if (!$this->offsetExists($index)) {
|
||||
throw new Exception('Configuration variable "' . $index . '" undefined');
|
||||
}
|
||||
return parent::offsetGet($index);
|
||||
|
Reference in New Issue
Block a user