Config_File
public class Config_File
Field Summary | |
---|---|
mixed | Controls whether config values of on/true/yes and off/false/no get converted to boolean values automatically. |
mixed | Controls whether or not to fix mac or dos formatted newlines. |
boolean | Controls whether variables with the same name overwrite each other. |
mixed | Controls whether hidden config sections/vars are read from the file. |
Constructor Summary | |
---|---|
Config_File(string config_path) Constructs a new config file class. |
Method Summary | |
---|---|
void | clear(string file_name) Clear loaded config data for a certain file or all files. |
string|array | get(string file_name, string section_name, string var_name) Retrieves config info based on the file, section, and variable name. |
array | Get all loaded config file names. |
string|array | get_key(mixed config_key, $file_name string) Retrieves config info based on the key. |
array | get_section_names(string file_name) Get all section names from a loaded file. |
array | get_var_names(string file_name, mixed section, string section_name) Get all global or section variable names. |
void | load_file(string file_name, boolean prepend_path) Load a configuration file manually. |
void | parse_contents(string contents) parse the source of a configuration file manually. |
void | set_file_contents(string config_file, string contents) Store the contents of a file manually. |
void | set_path(string config_path) Set the path where configuration files can be found. |
public mixed $booleanize = true
Controls whether config values of on/true/yes and off/false/no get converted to boolean values automatically.
public mixed $fix_newlines = true
Controls whether or not to fix mac or dos formatted newlines. If set to true, \r or \r\n will be changed to \n.
public boolean $overwrite = true
Controls whether variables with the same name overwrite each other.
public mixed $read_hidden = true
Controls whether hidden config sections/vars are read from the file.
public Config_File(string config_path)
Constructs a new config file class.
public void clear(string file_name)
Clear loaded config data for a certain file or all files.
public string|array get(string file_name, string section_name, string var_name)
Retrieves config info based on the file, section, and variable name.
public array get_file_names()
Get all loaded config file names.
public string|array get_key(mixed config_key, $file_name string)
Retrieves config info based on the key.
public array get_section_names(string file_name)
Get all section names from a loaded file.
public array get_var_names(string file_name, mixed section, string section_name)
Get all global or section variable names.
public void load_file(string file_name, boolean prepend_path)
Load a configuration file manually.
public void parse_contents(string contents)
parse the source of a configuration file manually.
public void set_file_contents(string config_file, string contents)
Store the contents of a file manually.
public void set_path(string config_path)
Set the path where configuration files can be found.
Config file reading class