abstract Kohana_Config_Reader
» ArrayObject
Abstract configuration reader.
Constants
integer 1
integer 2
Methods
public __construct ( )
Loads an empty array as the initial configuration and enables array keys to be used as properties.
Returns:
void
Source:
public function __construct()
{
parent::__construct(array(), ArrayObject::ARRAY_AS_PROPS);
}
public __toString ( )
Return the current group in serialized form.
Returns:
string
Source:
public function __toString()
{
return serialize($this->getArrayCopy());
}
public load ( string $group, array $config = NULL )
Loads a configuration group.
Returns:
$thisclone of the current object
Source:
public function load($group, array $config = NULL)
{
if ($config === NULL)
{
return FALSE;
}
// Set the group name
$this->_configuration_group = $group;
// Clone the current object
$object = clone $this;
// Swap the array with the actual configuration
$object->exchangeArray($config);
// Empty the configuration group
$this->_configuration_group = NULL;
return $object;
}
public as_array ( )
Return the raw array that is being used for this object.
Returns:
array
Source:
public function as_array()
{
return $this->getArrayCopy();
}
public get ( string $key, mixed $default = NULL )
Get a variable from the configuration or return the default value.
Returns:
mixed
Source:
public function get($key, $default = NULL)
{
return $this->offsetExists($key) ? $this->offsetGet($key) : $default;
}
public set ( string $key, mixed $value )
Sets a value in the configuration array.
Returns:
$this
Source:
public function set($key, $value)
{
$this->offsetSet($key, $value);
return $this;
}