Class Config (namespace Nette\Config)


Configuration storage.

ArrayObject
   |
   --Collection
      |
      --Hashtable
         |
         --Config
Author: David Grudl
Copyright: Copyright (c) 2004, 2009 David Grudl
Located: in /Config/Config.php (line 34)
Public Method Summary
Config
__construct ([array $arr = NULL], [$flags = self::READONLY])
void
expand ()
Expand all variables.
static Config
fromFile (string $file, [string $section = NULL], [int $flags = self::READONLY])
Creates new configuration object from file.
void
import (array|\Traversable $arr)
Import from array or any traversable object.
static void
registerExtension (string $extension, string $class)
Registers adapter for given file extension.
void
save (string $file, [string $section = NULL])
Save configuration to file.
array
toArray ()
Returns an array containing all of the elements in this collection.
& mixed
__get (int $key)
Returns item. Do not call directly.
bool
__isset (string $key)
Exists item?
void
__set (int $key, object $item)
Inserts (replaces) item. Do not call directly.
void
__unset (string $key)
Removes the element at the specified position in this list.
Methods Inherited From Hashtable
add(), append(), get(), getKeys(), import(), offsetExists(), offsetGet(), offsetSet(), offsetUnset(), search(), throwKeyNotFound()
Methods Inherited From Collection
__construct(), append(), beforeAdd(), beforeRemove(), clear(), contains(), exchangeArray(), getClass(), getIterator(), import(), isReadOnly(), remove(), search(), setArray(), setReadOnly(), __call(), __callStatic(), __get(), __isset(), __set(), __unset()
Methods Inherited From ArrayObject (Internal Class)
constructor __construct ( $array ), append ( $value ), asort ( ), count ( ), exchangeArray ( $array ), getArrayCopy ( ), getFlags ( ), getIterator ( ), getIteratorClass ( ), ksort ( ), natcasesort ( ), natsort ( ), offsetExists ( $index ), offsetGet ( $index ), offsetSet ( $index, $newval ), offsetUnset ( $index ), setFlags ( $flags ), setIteratorClass ( $iteratorClass ), uasort ( $cmp_function ), uksort ( $cmp_function )
Constant Summary
int EXPAND 2

line 38

flag
int READONLY 1

line 37

flag
Constants Inherited From ArrayObject (Internal Class)
ARRAY_AS_PROPS = 2, STD_PROP_LIST = 1
Variable Summary

Method Details

line 96

__construct

public Config __construct ([array $arr = NULL], [$flags = self::READONLY])

Input
array $arr to wrap
$flags
Output
Config  
Throws
throws InvalidArgumentException

line 140

expand

public void expand ()

Expand all variables.

Output
void  

line 78

fromFile

public static Config fromFile (string $file, [string $section = NULL], [int $flags = self::READONLY])

Creates new configuration object from file.

Input
string $file file name
string $section section to load
int $flags flags (readOnly, autoexpand variables)
Output
Config  

line 165

import

public void import (array|\Traversable $arr)

Import from array or any traversable object.

Input
array|\Traversable $arr
Output
void  
Throws
throws InvalidArgumentException

line 55

registerExtension

public static void registerExtension (string $extension, string $class)

Registers adapter for given file extension.

Input
string $extension file extension
string $class class name (IConfigAdapter)
Output
void  

line 119

save

public void save (string $file, [string $section = NULL])

Save configuration to file.

Input
string $file file
string $section section to write
Output
void  

line 187

toArray

public array toArray ()

Returns an array containing all of the elements in this collection.

Output
array  

line 209

__get

public mixed & __get (int $key)

Returns item. Do not call directly.

Input
int $key index
Output
& mixed  

line 235

__isset

public bool __isset (string $key)

Exists item?

Input
string $key name
Output
bool  

line 223

__set

public void __set (int $key, object $item)

Inserts (replaces) item. Do not call directly.

Input
int $key index
object $item
Output
void  

line 247

__unset

public void __unset (string $key)

Removes the element at the specified position in this list.

Input
string $key name
Output
void