ARTISAN PROJECT ArtisanSmarty
[ class tree: ArtisanSmarty ] [ index: ArtisanSmarty ] [ all elements ]

Class: Config_File

Source Location: /ccdb/bbs/lib/smarty/Config_File.class.php

Class Config_File

Property Summary
mixed   $booleanize   Controls whether config values of on/true/yes and off/false/no get converted to boolean values automatically.
mixed   $fix_newlines   Controls whether or not to fix mac or dos formatted newlines.
mixed   $overwrite   Controls whether variables with the same name overwrite each other.
mixed   $read_hidden   Controls whether hidden config sections/vars are read from the file.
mixed   $_config_data  

[ Top ]
Method Summary
Config_File   Config_File()   Constructs a new config file class.
void   clear()   Clear loaded config data for a certain file or all files.
string|array   get()   Retrieves config info based on the file, section, and variable name.
array   get_file_names()   Get all loaded config file names.
string|array   &get_key()   Retrieves config info based on the key.
array   get_section_names()   Get all section names from a loaded file.
array   get_var_names()   Get all global or section variable names.
void   load_file()   Load a configuration file manually.
void   parse_contents()   parse the source of a configuration file manually.
void   set_file_contents()   Store the contents of a file manually.
void   set_path()   Set the path where configuration files can be found.
void   _set_config_var()  
void   _trigger_error_msg()  

[ Top ]
Properties
mixed   $booleanize = true [line 61]

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

Options


[ Top ]
mixed   $fix_newlines = true [line 72]

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.


[ Top ]
mixed   $overwrite = true [line 55]

Controls whether variables with the same name overwrite each other.

Options


[ Top ]
mixed   $read_hidden = true [line 66]

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

Options


[ Top ]
mixed   $_config_data = array() [line 77]

[ Top ]
Methods
Constructor Config_File  [line 85]

  Config_File Config_File( [string $config_path = NULL]  )

Constructs a new config file class.

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


[ Top ]
clear  [line 226]

  void clear( [string $file_name = NULL]  )

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

Parameters:
string   $file_name:  file to clear config data for


[ Top ]
get  [line 121]

  string|array get( string $file_name, [string $section_name = NULL], [string $var_name = NULL]  )

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

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

API Tags:
Return:  a value or array of values

Information Tags:
Usedby:  Config_File::get_key() - retrieves information from config file and returns it
Usedby:  Config_File::get_key() - retrieves information from config file and returns it

[ Top ]
get_file_names  [line 173]

  array get_file_names( )

Get all loaded config file names.


API Tags:
Return:  an array of loaded config file names


[ Top ]
get_key  [line 161]

  string|array &get_key( $file_name $config_key  )

Retrieves config info based on the key.

Parameters:
$file_name   $config_key:  string config key (filename/section/var)

API Tags:
Return:  same as get()
Uses:  Config_File::get() - retrieves information from config file and returns it


[ Top ]
get_section_names  [line 185]

  array get_section_names( string $file_name  )

Get all section names from a loaded file.

Parameters:
string   $file_name:  config file to get section names from

API Tags:
Return:  an array of section names from the specified file


[ Top ]
get_var_names  [line 204]

  array get_var_names( string $file_name, [mixed $section = NULL], string $section_name  )

Get all global or section variable names.

Parameters:
string   $file_name:  config file to get info for
string   $section_name:  (optional) section to get info for

API Tags:
Return:  an array of variables names from the specified file/section


[ Top ]
load_file  [line 242]

  void load_file( string $file_name, [boolean $prepend_path = true]  )

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  [line 280]

  void parse_contents( string $contents  )

parse the source of a configuration file manually.

Parameters:
string   $contents:  the file-contents to parse


[ Top ]
set_file_contents  [line 269]

  void set_file_contents( string $config_file, string $contents  )

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  [line 97]

  void set_path( string $config_path  )

Set the path where configuration files can be found.

Parameters:
string   $config_path:  path to the config files


[ Top ]
_set_config_var  [line 361]

  void _set_config_var( array &$container, string $var_name, mixed $var_value, boolean $booleanize  )

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


[ Top ]
_trigger_error_msg  [line 395]

  void _trigger_error_msg( string $error_msg, [integer $error_type = E_USER_WARNING]  )

Parameters:
string   $error_msg: 
integer   $error_type:  one of

API Tags:
Uses:  trigger_error() - creates a PHP warning/error


[ Top ]

Documentation generated on Thu, 04 Jan 2007 17:46:50 +0900