Class Config_File

Description

Config file reading class

Located in /legacy/smarty/Config_File.class.php (line 38)


	
			
Variable Summary
boolean $booleanize
boolean $fix_newlines
boolean $overwrite
boolean $read_hidden
Method Summary
Config_File Config_File ([string $config_path = NULL])
void clear ([string $file_name = NULL])
string|array get (string $file_name, [string $section_name = NULL], [string $var_name = NULL])
array get_file_names ()
string|array &get_key ($file_name $config_key)
array get_section_names (string $file_name)
array get_var_names (string $file_name, [ $section = NULL], string $section_name)
void load_file (string $file_name, [boolean $prepend_path = true])
void parse_contents (string $contents)
void set_file_contents (string $config_file, string $contents)
void set_path (string $config_path)
Variables
boolean $booleanize = true (line 52)

Controls whether config values of on/true/yes and off/false/no get converted to boolean values automatically.

Options

boolean $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.

boolean $overwrite = true (line 46)

Controls whether variables with the same name overwrite each other.

Options

boolean $read_hidden = true (line 57)

Controls whether hidden config sections/vars are read from the file.

Options

mixed $_config_data = array() (line 68)
Methods
Constructor Config_File (line 76)

Constructs a new config file class.

Config_File Config_File ([string $config_path = NULL])
  • string $config_path: (optional) path to the config files
clear (line 217)

Clear loaded config data for a certain file or all files.

void clear ([string $file_name = NULL])
  • string $file_name: file to clear config data for
get (line 112)

Retrieves config info based on the file, section, and variable name.

  • return: a value or array of values
  • usedby: Config_File::get_key() - retrieves information from config file and returns it
string|array get (string $file_name, [string $section_name = NULL], [string $var_name = NULL])
  • 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
get_file_names (line 164)

Get all loaded config file names.

  • return: an array of loaded config file names
array get_file_names ()
get_key (line 152)

Retrieves config info based on the key.

  • return: same as get()
  • uses: Config_File::get() - retrieves information from config file and returns it
string|array &get_key ($file_name $config_key)
  • $file_name $config_key: string config key (filename/section/var)
get_section_names (line 176)

Get all section names from a loaded file.

  • return: an array of section names from the specified file
array get_section_names (string $file_name)
  • string $file_name: config file to get section names from
get_var_names (line 195)

Get all global or section variable names.

  • return: an array of variables names from the specified file/section
array get_var_names (string $file_name, [ $section = NULL], string $section_name)
  • string $file_name: config file to get info for
  • string $section_name: (optional) section to get info for
  • $section
load_file (line 233)

Load a configuration file manually.

void load_file (string $file_name, [boolean $prepend_path = true])
  • string $file_name: file name to load
  • boolean $prepend_path: whether current config path should be prepended to the filename
parse_contents (line 271)

parse the source of a configuration file manually.

void parse_contents (string $contents)
  • string $contents: the file-contents to parse
set_file_contents (line 260)

Store the contents of a file manually.

void set_file_contents (string $config_file, string $contents)
  • string $config_file: file name of the related contents
  • string $contents: the file-contents to parse
set_path (line 88)

Set the path where configuration files can be found.

void set_path (string $config_path)
  • string $config_path: path to the config files

Documentation generated on Tue, 09 Aug 2011 09:04:45 +0200 by phpDocumentor 1.4.3