abstract Kohana_Config_Reader
» ArrayObject

Abstract configuration reader.

package
Kohana
author
Kohana Team
copyright
© 2008-2009 Kohana Team
license
http://kohanaphp.com/license.html

Constants

STD_PROP_LIST
integer 1
ARRAY_AS_PROPS
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:
  • $this clone 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;
}

public offsetExists ( )

public offsetGet ( )

public offsetSet ( )

public offsetUnset ( )

public append ( )

public getArrayCopy ( )

public count ( )

public getFlags ( )

public setFlags ( )

public asort ( )

public ksort ( )

public uasort ( )

public uksort ( )

public natsort ( )

public natcasesort ( )

public getIterator ( )

public exchangeArray ( )

public setIteratorClass ( )

public getIteratorClass ( )