PHP Class Phergie_Config, phergie

Author: Phergie Development Team ([email protected])
Inheritance: implements ArrayAccess
Show file Open project: phergie/phergie Class Usage Examples

Protected Properties

Property Type Description
$files array Mapping of configuration file paths to an array of names of settings they contain
$settings array Mapping of setting names to their current corresponding values

Public Methods

Method Description
offsetExists ( string $offset ) : boolean Checks to see if a configuration setting is assigned a value.
offsetGet ( string $offset ) : mixed Returns the value of a configuration setting.
offsetSet ( string $offset, mixed $value ) : void Sets the value of a configuration setting.
offsetUnset ( string $offset ) : void Removes the value set for a configuration setting.
read ( string $file ) : Phergie_Config Includes a specified PHP configuration file and incorporates its return value (which should be an associative array) into the current configuration settings.
readArray ( array $settings ) : Phergie_Config Merges an associative array of configuration setting values into the current configuration settings.
write ( ) : Phergie_Config Writes the values of the current configuration settings back to their originating files.

Method Details

offsetExists() public method

Checks to see if a configuration setting is assigned a value.
See also: ArrayAccess::offsetExists()
public offsetExists ( string $offset ) : boolean
$offset string Configuration setting name
return boolean TRUE if the setting has a value, FALSE otherwise

offsetGet() public method

Returns the value of a configuration setting.
See also: ArrayAccess::offsetGet()
public offsetGet ( string $offset ) : mixed
$offset string Configuration setting name
return mixed Configuration setting value or NULL if it is not assigned a value

offsetSet() public method

Sets the value of a configuration setting.
See also: ArrayAccess::offsetSet()
public offsetSet ( string $offset, mixed $value ) : void
$offset string Configuration setting name
$value mixed New setting value
return void

offsetUnset() public method

Removes the value set for a configuration setting.
See also: ArrayAccess::offsetUnset()
public offsetUnset ( string $offset ) : void
$offset string Configuration setting name
return void

read() public method

Includes a specified PHP configuration file and incorporates its return value (which should be an associative array) into the current configuration settings.
public read ( string $file ) : Phergie_Config
$file string Path to the file to read
return Phergie_Config Provides a fluent interface

readArray() public method

Merges an associative array of configuration setting values into the current configuration settings.
public readArray ( array $settings ) : Phergie_Config
$settings array Associative array of configuration setting values keyed by setting name
return Phergie_Config Provides a fluent interface

write() public method

Writes the values of the current configuration settings back to their originating files.
public write ( ) : Phergie_Config
return Phergie_Config Provides a fluent interface

Property Details

$files protected property

Mapping of configuration file paths to an array of names of settings they contain
protected array $files
return array

$settings protected property

Mapping of setting names to their current corresponding values
protected array $settings
return array