Inherited Variables
Inherited Constants
Inherited Methods
Class Details
Config file reading class
[ Top ]
Class Variables
$booleanize = true
[line 52]
Controls whether config values of on/true/yes and off/false/no get converted to boolean values automatically.
Options
Type: boolean
Overrides:
[ Top ]
$fix_newlines = true
[line 63]
Controls whether or not to fix mac or dos formatted newlines.
Options If set to true, \r or \r\n will be changed to \n.
Type: boolean
Overrides:
[ Top ]
$overwrite = true
[line 46]
Controls whether variables with the same name overwrite each other.
Options
Type: boolean
Overrides:
[ Top ]
$read_hidden = true
[line 57]
Controls whether hidden config sections/vars are read from the file.
Options
Type: boolean
Overrides:
[ Top ]
$_config_data = array()
[line 68]
Type: mixed
Overrides:
[ Top ]
Class Methods
Config_File
Config_File Config_File(
[string
$config_path = NULL])
[line 76]
Constructs a new config file class.
Parameters:
- string $config_path - (optional) path to the config files
[ Top ]
clear
void clear(
[string
$file_name = NULL])
[line 217]
Clear loaded config data for a certain file or all files.
Parameters:
- string $file_name - file to clear config data for
[ Top ]
get
string|array get(
string
$file_name, [string
$section_name = NULL], [string
$var_name = NULL])
[line 112]
Retrieves config info based on the file, section, and variable name.
Tags:
- return - a value or array of values
- usedby - Config_File::get_key() - retrieves information from config file and returns it
Parameters:
- 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
[ Top ]
get_file_names
array get_file_names(
)
[line 164]
Get all loaded config file names.
Tags:
- return - an array of loaded config file names
Parameters:
[ Top ]
get_key
string|array &get_key(
$file_name
$config_key)
[line 152]
Retrieves config info based on the key.
Tags:
- return - same as get()
- uses - Config_File::get() - retrieves information from config file and returns it
Parameters:
- $file_name $config_key - string config key (filename/section/var)
[ Top ]
get_section_names
array get_section_names(
string
$file_name)
[line 176]
Get all section names from a loaded file.
Tags:
- return - an array of section names from the specified file
Parameters:
- string $file_name - config file to get section names from
[ Top ]
get_var_names
array get_var_names(
string
$file_name, [
$section = NULL], string
$section_name)
[line 195]
Get all global or section variable names.
Tags:
- return - an array of variables names from the specified file/section
Parameters:
- string $file_name - config file to get info for
- string $section_name - (optional) section to get info for
- $section -
[ Top ]
load_file
void load_file(
string
$file_name, [boolean
$prepend_path = true])
[line 233]
Load a configuration file manually.
Parameters:
- string $file_name - file name to load
- boolean $prepend_path - whether current config path should be prepended to the filename
[ Top ]
parse_contents
void parse_contents(
string
$contents)
[line 271]
parse the source of a configuration file manually.
Parameters:
- string $contents - the file-contents to parse
[ Top ]
set_file_contents
void set_file_contents(
string
$config_file, string
$contents)
[line 260]
Store the contents of a file manually.
Parameters:
- string $config_file - file name of the related contents
- string $contents - the file-contents to parse
[ Top ]
set_path
void set_path(
string
$config_path)
[line 88]
Set the path where configuration files can be found.
Parameters:
- string $config_path - path to the config files
[ Top ]