Smarty
[ class tree: Smarty ] [ index: Smarty ] [ all elements ]

Class: Config_File

Source Location: /libs/Config_File.class.php

Class Overview


Config file reading class


Variables

Methods



Class Details

[line 34]
Config file reading class



[ Top ]


Class Variables

$booleanize =     true

[line 48]

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

Options



Type:   mixed


[ Top ]

$fix_newlines =     true

[line 59]

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:   mixed


[ Top ]

$overwrite =     true

[line 42]

Controls whether variables with the same name overwrite each other.

Options



Type:   mixed


[ Top ]

$read_hidden =     true

[line 53]

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

Options



Type:   mixed


[ Top ]

$_config_data = array()

[line 64]


Type:   mixed


[ Top ]



Class Methods


constructor Config_File [line 72]

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 ]

method clear [line 213]

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 ]

method get [line 108]

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.



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 ]

method get_file_names [line 160]

array get_file_names( )

Get all loaded config file names.



Tags:

return:  an array of loaded config file names


[ Top ]

method get_key [line 148]

string|array &get_key( mixed $config_key)

Retrieves config info based on the key.



Tags:

return:  same as get()
uses:  Config_File::get() - retrieves information from config file and returns it


[ Top ]

method get_section_names [line 172]

array get_section_names( string $file_name)

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 ]

method get_var_names [line 191]

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

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 ]

method load_file [line 229]

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 ]

method parse_contents [line 267]

void parse_contents( string $contents)

parse the source of a configuration file manually.



Parameters:

string   $contents   the file-contents to parse

[ Top ]

method set_file_contents [line 256]

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 ]

method set_path [line 84]

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 ]


Documentation generated on Thu, 29 Jun 2006 22:13:12 +0200 by phpDocumentor 1.3.0RC6