Methods summary
public
|
#
Config_File( string $config_path = NULL )
Constructs a new config file class.
Constructs a new config file class.
Parameters
- $config_path
string (optional) path to the config files
|
public
|
#
set_path( string $config_path )
Set the path where configuration files can be found.
Set the path where configuration files can be found.
Parameters
- $config_path
string path to the config files
|
public
string|array
|
#
get( string $file_name, string $section_name = NULL, string $var_name = NULL )
Retrieves config info based on the file, section, and variable name.
Retrieves config info based on the file, section, and variable name.
Parameters
- $file_name
string config file to get info for
- $section_name
string (optional) section to get info for
- $var_name
string (optional) variable to get info for
Returns
string|array a value or array of values
Used by
|
public
string|array
&
|
#
get_key( $file_name $config_key )
Retrieves config info based on the key.
Retrieves config info based on the key.
Parameters
- $config_key
$file_name string config key (filename/section/var)
Returns
string|array same as get()
Uses
|
public
array
|
#
get_file_names( )
Get all loaded config file names.
Get all loaded config file names.
Returns
array an array of loaded config file names
|
public
array
|
#
get_section_names( string $file_name )
Get all section names from a loaded file.
Get all section names from a loaded file.
Parameters
- $file_name
string config file to get section names from
Returns
array an array of section names from the specified file
|
public
array
|
#
get_var_names( string $file_name, string $section = NULL )
Get all global or section variable names.
Get all global or section variable names.
Parameters
- $file_name
string config file to get info for
- $section
string $section_name (optional) section to get info for
Returns
array an array of variables names from the specified file/section
|
public
|
#
clear( string $file_name = NULL )
Clear loaded config data for a certain file or all files.
Clear loaded config data for a certain file or all files.
Parameters
- $file_name
string file to clear config data for
|
public
|
#
load_file( string $file_name, boolean $prepend_path = true )
Load a configuration file manually.
Load a configuration file manually.
Parameters
- $file_name
string file name to load
- $prepend_path
boolean whether current config path should be prepended to the filename
|
public
|
#
set_file_contents( string $config_file, string $contents )
Store the contents of a file manually.
Store the contents of a file manually.
Parameters
- $config_file
string file name of the related contents
- $contents
string the file-contents to parse
|
public
|
#
parse_contents( string $contents )
parse the source of a configuration file manually.
parse the source of a configuration file manually.
Parameters
- $contents
string the file-contents to parse
|
public
|
#
_set_config_var( array & $container, string $var_name, mixed $var_value, boolean $booleanize )
Parameters
- $container
array &$container
- $var_name
string
- $var_value
mixed
- $booleanize
boolean determines whether $var_value is converted to to true/false
|
public
|
#
_trigger_error_msg( string $error_msg, integer $error_type = E_USER_WARNING )
Parameters
- $error_msg
string
- $error_type
integer one of
Uses
trigger_error() creates a PHP warning/error
|