Class flConfig
flConfig Class
Class to provide access to configuration data held in arrays.
-
flConfig
implements
Iterator,
Countable
Package: fusionLib
Copyright:
Copyright (c) 2007 - 2013 fusionLib. All rights reserved.
Located at system/libs/Config/flConfig.php
Methods summary
public
|
#
__construct( string $namespace, array $data = null )
Construct a new configuration object.
Construct a new configuration object.
Parameters
- $namespace
- The namespace/filename for the configuration data.
- $data
- The optional array of data, if given the config is not loaded from the file.
|
public
string
|
#
getNamespace( )
Return the namespace for the config data.
Return the namespace for the config data.
Returns
string The namespace.
|
public
|
#
__set( string $key, mixed $value )
Set a configuration item.
Set a configuration item.
Configurations are read only therefore this throws an exception.
Parameters
- $key
- The name of the configuration item to set.
- $value
- The value to set for the item.
Throws
|
public
|
#
__unset( string $key )
Unset a configuration item.
Unset a configuration item.
Configurations are read only therefore this throws an exception.
Parameters
- $key
- The name of the configuration item to unset.
Throws
|
public
mixed
|
#
get( string $key, mixed $default = null )
Get the configuration item.
Get the configuration item.
If the items is not present then the default value is returned.
Parameters
- $key
- The name of the item to get.
- $default
- The default value to use if the item is not present.
Returns
mixed The value assigned to the key or the default value.
|
public
mixed
|
#
__get( string $key )
Read a configuration value.
Read a configuration value.
If the value is not present then an error is reported and the function never returns.
Parameters
- $key
- The name of the configuration item to get.
Returns
mixed The value assigned to the item.
Throws
|
public
boolean
|
#
__isset( string $name )
Test if a configuration key is set.
Test if a configuration key is set.
Parameters
- $name
- The name of the configuration key to test for.
Returns
boolean True if the key is present; else false.
|
public
integer
|
#
count( )
The number of config items.
The number of config items.
Returns
integer Number of items.
Implementation of
Countable::count()
|
public
mixed|
|
#
next( )
Get the next item.
Returns
mixed| The item.
Implementation of
Iterator::next()
|
public
mixed|
|
#
rewind( )
Move to the first item.
Returns
mixed| The item.
Implementation of
Iterator::rewind()
|
public
mixed
|
#
key( )
Get the key.
Returns
mixed The key.
Implementation of
Iterator::key()
|
public
mixed
|
#
current( )
Get the current item.
Returns
mixed The item.
Implementation of
Iterator::current()
|
public
boolean
|
#
valid( )
Test if the position in the array is valid.
Test if the position in the array is valid.
Returns
boolean true if valid; else false.
Implementation of
Iterator::valid()
|
Properties summary
protected
array
|
$data
|
|
protected
string
|
$namespace
|
|