Public Member Functions | |
Config_File ($config_path=NULL) | |
set_path ($config_path) | |
get ($file_name, $section_name=NULL, $var_name=NULL) | |
& | get_key ($config_key) |
get_file_names () | |
get_section_names ($file_name) | |
get_var_names ($file_name, $section=NULL) | |
clear ($file_name=NULL) | |
load_file ($file_name, $prepend_path=true) | |
set_file_contents ($config_file, $contents) | |
parse_contents ($contents) | |
_set_config_var (&$container, $var_name, $var_value, $booleanize) | |
_trigger_error_msg ($error_msg, $error_type=E_USER_WARNING) | |
Data Fields | |
$overwrite = true | |
$booleanize = true | |
$read_hidden = true | |
$fix_newlines = true | |
$_config_path = "" | |
$_config_data = array() |
Definition at line 34 of file Config_File.class.php.
_set_config_var | ( | &$ | container, |
$ | var_name, | ||
$ | var_value, | ||
$ | booleanize | ||
) |
#@+ private
array | &$container | |
string | $var_name | |
mixed | $var_value | |
boolean | $booleanize | determines whether $var_value is converted to to true/false |
Definition at line 348 of file Config_File.class.php.
_trigger_error_msg | ( | $ | error_msg, |
$ | error_type = E_USER_WARNING |
||
) |
trigger_error() creates a PHP warning/error
string | $error_msg | |
integer | $error_type | one of |
Definition at line 382 of file Config_File.class.php.
clear | ( | $ | file_name = NULL ) |
Clear loaded config data for a certain file or all files.
string | $file_name | file to clear config data for |
Definition at line 213 of file Config_File.class.php.
Config_File | ( | $ | config_path = NULL ) |
#@- Constructs a new config file class.
string | $config_path | (optional) path to the config files |
Definition at line 72 of file Config_File.class.php.
get | ( | $ | file_name, |
$ | section_name = NULL , |
||
$ | var_name = NULL |
||
) |
Retrieves config info based on the file, section, and variable name.
string | $file_name | config file to get info for |
string | $section_name | (optional) section to get info for |
string | $var_name | (optional) variable to get info for |
Definition at line 108 of file Config_File.class.php.
get_file_names | ( | ) |
Get all loaded config file names.
Definition at line 160 of file Config_File.class.php.
& get_key | ( | $ | config_key ) |
Retrieves config info based on the key.
$file_name | string config key (filename/section/var) |
Definition at line 148 of file Config_File.class.php.
get_section_names | ( | $ | file_name ) |
Get all section names from a loaded file.
string | $file_name | config file to get section names from |
Definition at line 172 of file Config_File.class.php.
get_var_names | ( | $ | file_name, |
$ | section = NULL |
||
) |
Get all global or section variable names.
string | $file_name | config file to get info for |
string | $section_name | (optional) section to get info for |
Definition at line 191 of file Config_File.class.php.
load_file | ( | $ | file_name, |
$ | prepend_path = true |
||
) |
Load a configuration file manually.
string | $file_name | file name to load |
boolean | $prepend_path | whether current config path should be prepended to the filename |
Definition at line 229 of file Config_File.class.php.
parse_contents | ( | $ | contents ) |
parse the source of a configuration file manually.
string | $contents | the file-contents to parse |
Definition at line 267 of file Config_File.class.php.
set_file_contents | ( | $ | config_file, |
$ | contents | ||
) |
Store the contents of a file manually.
string | $config_file | file name of the related contents |
string | $contents | the file-contents to parse |
Definition at line 256 of file Config_File.class.php.
set_path | ( | $ | config_path ) |
Set the path where configuration files can be found.
string | $config_path | path to the config files |
Definition at line 84 of file Config_File.class.php.
$_config_path = "" |
#@- private
Definition at line 63 of file Config_File.class.php.
$booleanize = true |
Controls whether config values of on/true/yes and off/false/no get converted to boolean values automatically.
Definition at line 48 of file Config_File.class.php.
$fix_newlines = true |
Controls whether or not to fix mac or dos formatted newlines. If set to true, or
will be changed to
.
Definition at line 59 of file Config_File.class.php.
$overwrite = true |
Controls whether variables with the same name overwrite each other.
Definition at line 42 of file Config_File.class.php.
$read_hidden = true |
Controls whether hidden config sections/vars are read from the file.
Definition at line 53 of file Config_File.class.php.