Class Base
Base structure for managing configuration files. Every configuration manager
should implement this class.
Methods summary
abstract public
|
#
Load( string $directory, string $configuration_file )
Loads all configuration options of a given file and creates it if does not
exists.
Loads all configuration options of a given file and creates it if does not
exists.
Parameters
- $directory
string $directory
- $configuration_file
string $configuration_file
|
abstract public
|
#
Write( )
Writes a configuration file using the settings array.
Writes a configuration file using the settings array.
|
public
boolean
|
#
Get( string $option )
Get an option value.
Parameters
Returns
boolean
|
public
array
|
#
GetAll( )
Get all preferences.
Returns
array
|
public
boolean|string
|
#
GetGroupValue( string $group, string $option )
Get the value of an option on a specific configuration group.
Get the value of an option on a specific configuration group.
Parameters
- $group
string $group
- $option
string $option
Returns
boolean|string
|
public
|
#
Set( type $option, type $value )
Modifies or adds an option value and writes it to the configuration file
immediately.
Modifies or adds an option value and writes it to the configuration file
immediately.
Parameters
- $option
type $option
- $value
type $value
|
public
|
#
SetGroupValue( string $group, string $option, string $value )
Edits or creates a new group and option and writes it to the configuration
file immediately.
Edits or creates a new group and option and writes it to the configuration
file immediately.
Parameters
- $group
string $group
- $option
string $option
- $value
string $value
|
Properties summary
protected
array
|
$preferences
|
|
#
All preferences stored on a configuration file.
All preferences stored on a configuration file.
Format of this array for single options: $settings["option"] = "value"
Format of this array for a group of options: $settings["group"] = array(
"option" => "value", "option2" => "value2" )
|
public
string
|
$directory
|
|
#
Directory of configuration file.
Directory of configuration file.
|
public
string
|
$file
|
|
#
Full path of configuration file.
Full path of configuration file.
|