XOOPS 2.5.6  Final
 All Classes Namespaces Files Functions Variables Pages
Config_File Class Reference

Public Member Functions

 _set_config_var (&$container, $var_name, $var_value, $booleanize)
 
 _trigger_error_msg ($error_msg, $error_type=E_USER_WARNING)
 
 clear ($file_name=NULL)
 
 Config_File ($config_path=NULL)
 
 get ($file_name, $section_name=NULL, $var_name=NULL)
 
 get_file_names ()
 
get_key ($config_key)
 
 get_section_names ($file_name)
 
 get_var_names ($file_name, $section=NULL)
 
 load_file ($file_name, $prepend_path=true)
 
 parse_contents ($contents)
 
 set_file_contents ($config_file, $contents)
 
 set_path ($config_path)
 

Public Attributes

 $_config_data = array()
 
 $_config_path = ""
 
 $booleanize = true
 
 $fix_newlines = true
 
 $overwrite = true
 
 $read_hidden = true
 

Detailed Description

Definition at line 38 of file Config_File.class.php.

Member Function Documentation

Config_File::_set_config_var ( $container,
  $var_name,
  $var_value,
  $booleanize 
)

#@+ private

Parameters
array&$container
string$var_name
mixed$var_value
boolean$booleanizedetermines whether $var_value is converted to to true/false

Definition at line 352 of file Config_File.class.php.

References $booleanize, and _trigger_error_msg().

Referenced by parse_contents().

Here is the call graph for this function:

Here is the caller graph for this function:

Config_File::_trigger_error_msg (   $error_msg,
  $error_type = E_USER_WARNING 
)

trigger_error() creates a PHP warning/error

Parameters
string$error_msg
integer$error_typeone of

Definition at line 386 of file Config_File.class.php.

Referenced by _set_config_var(), get(), get_section_names(), get_var_names(), load_file(), and set_path().

Here is the caller graph for this function:

Config_File::clear (   $file_name = NULL)

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

Parameters
string$file_namefile to clear config data for

Definition at line 217 of file Config_File.class.php.

Config_File::Config_File (   $config_path = NULL)

#@- Constructs a new config file class.

Parameters
string$config_path(optional) path to the config files

Definition at line 76 of file Config_File.class.php.

References set_path().

Here is the call graph for this function:

Config_File::get (   $file_name,
  $section_name = NULL,
  $var_name = NULL 
)

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

Parameters
string$file_nameconfig file to get info for
string$section_name(optional) section to get info for
string$var_name(optional) variable to get info for
Returns
string|array a value or array of values

Definition at line 112 of file Config_File.class.php.

References _trigger_error_msg(), and load_file().

Here is the call graph for this function:

Config_File::get_file_names ( )

Get all loaded config file names.

Returns
array an array of loaded config file names

Definition at line 164 of file Config_File.class.php.

& Config_File::get_key (   $config_key)

Retrieves config info based on the key.

Parameters
$file_namestring config key (filename/section/var)
Returns
string|array same as get() get() retrieves information from config file and returns it

Definition at line 152 of file Config_File.class.php.

References $result.

Config_File::get_section_names (   $file_name)

Get all section names from a loaded file.

Parameters
string$file_nameconfig file to get section names from
Returns
array an array of section names from the specified file

Definition at line 176 of file Config_File.class.php.

References _trigger_error_msg().

Here is the call graph for this function:

Config_File::get_var_names (   $file_name,
  $section = NULL 
)

Get all global or section variable names.

Parameters
string$file_nameconfig file to get info for
string$section_name(optional) section to get info for
Returns
array an array of variables names from the specified file/section

Definition at line 195 of file Config_File.class.php.

References _trigger_error_msg().

Here is the call graph for this function:

Config_File::load_file (   $file_name,
  $prepend_path = true 
)

Load a configuration file manually.

Parameters
string$file_namefile name to load
boolean$prepend_pathwhether current config path should be prepended to the filename

Definition at line 233 of file Config_File.class.php.

References _trigger_error_msg(), and parse_contents().

Referenced by get().

Here is the call graph for this function:

Here is the caller graph for this function:

Config_File::parse_contents (   $contents)

parse the source of a configuration file manually.

Parameters
string$contentsthe file-contents to parse

Definition at line 271 of file Config_File.class.php.

References $booleanize, $i, $pos, $vars, and _set_config_var().

Referenced by load_file(), and set_file_contents().

Here is the call graph for this function:

Here is the caller graph for this function:

Config_File::set_file_contents (   $config_file,
  $contents 
)

Store the contents of a file manually.

Parameters
string$config_filefile name of the related contents
string$contentsthe file-contents to parse

Definition at line 260 of file Config_File.class.php.

References parse_contents().

Here is the call graph for this function:

Config_File::set_path (   $config_path)

Set the path where configuration files can be found.

Parameters
string$config_pathpath to the config files

Definition at line 88 of file Config_File.class.php.

References _trigger_error_msg(), and DIRECTORY_SEPARATOR.

Referenced by Config_File().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

Config_File::$_config_data = array()

Definition at line 68 of file Config_File.class.php.

Config_File::$_config_path = ""

#@- private

Definition at line 67 of file Config_File.class.php.

Config_File::$booleanize = true

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

Definition at line 52 of file Config_File.class.php.

Referenced by _set_config_var(), and parse_contents().

Config_File::$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 63 of file Config_File.class.php.

Config_File::$overwrite = true

Controls whether variables with the same name overwrite each other.

Definition at line 46 of file Config_File.class.php.

Config_File::$read_hidden = true

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

Definition at line 57 of file Config_File.class.php.


The documentation for this class was generated from the following file: