Config Class Reference

Inheritance diagram for Config:
ConfigHtml ConfigUpgrade

Public Member Functions

 Config ($config_code)
 load ()
 init_property_list ()
 load_def_file ()
 build_config_filename ()
 get_conf_name ()
 get_property ($name)
 set_property ($name, $value)
 get_property_list ()
 validate ($newPropertyList)
 validate_property ($name, $value)
 save ($generatorFile=__FILE__)
 init_md5 ()
 get_md5 ()
 calculate_md5 ()
 save_md5 ()
 is_modified ()
 retrieve_accepted_values_from_folder ($path, $elt_type, $elt_extension=null, $elt_disallowed=null)
 get_conf_class ()
 get_config_filename ()

Data Fields

 $config_code
 $config_filename
 $def_filename
 $property_list = array()
 $conf_def = array()
 $conf_dirname = ''
 $def_dirname = ''
 $conf_def_property_list = array()
 $md5
 $backlog
 $def_loaded

Detailed Description

To use this class.

Example : $fooConfig = new Config('CLFOO');

$fooConfig->load(); Load property with actual values in configs files. $fooConfig->save(); write a new config file if (following def file), a property would be in the config file, and this property is in memory, the value would be write in the new config file)

Definition at line 41 of file config.class.php.


Member Function Documentation

build_config_filename (  ) 

Build the path and filename of the config file

Returns:
string : complete path and name of config file

Definition at line 216 of file config.class.php.

calculate_md5 (  ) 

Calculate the md5 value of the config file

Definition at line 674 of file config.class.php.

Config ( config_code  ) 

constructor, build a config object

Parameters:
string $config_code

Definition at line 82 of file config.class.php.

get_conf_class (  ) 

Return the name (public label) of the config class

Definition at line 816 of file config.class.php.

get_conf_name (  ) 

Get the name of configuration in definition

Returns:
string name of the current config

Definition at line 236 of file config.class.php.

get_config_filename (  ) 

Return the filename of configuration file

Definition at line 829 of file config.class.php.

get_md5 (  ) 

Get the md5 value

Definition at line 665 of file config.class.php.

get_property ( name  ) 

Get the value of a property

Parameters:
string $name value name
Returns:
value of the givent property | null if not found

Definition at line 258 of file config.class.php.

get_property_list (  ) 

Get the property/value list

Returns:
array associative list property name/value

Definition at line 306 of file config.class.php.

init_md5 (  ) 

Init the value of md5

Definition at line 638 of file config.class.php.

init_property_list (  ) 

Initialise property list : get default values in definition file and overwrite then with values in configuration file

Definition at line 131 of file config.class.php.

is_modified (  ) 

Verify if config file is manually updated

Definition at line 724 of file config.class.php.

load (  ) 

load definition and configuration file

Reimplemented in ConfigUpgrade.

Definition at line 95 of file config.class.php.

load_def_file (  ) 

Read defintion file and set value of $conf_def and $conf_def_property_list

Definition at line 196 of file config.class.php.

retrieve_accepted_values_from_folder ( path,
elt_type,
elt_extension = null,
elt_disallowed = null 
)

Retrieve accepted value from a folder (ie : lang folder, css, folder, ...)

Definition at line 747 of file config.class.php.

save ( generatorFile = __FILE__  ) 

Save all properties in config file

Definition at line 500 of file config.class.php.

save_md5 (  ) 

Save md5 in database and re-initialise the value of md5

Definition at line 683 of file config.class.php.

set_property ( name,
value 
)

Set the value of a property with validation.

Parameters:
string $name value name
mixed $value content for the property to set
Returns:
boolean true on success | false if unvalid or unknow value

Definition at line 279 of file config.class.php.

validate ( newPropertyList  ) 

Validate value of the list of new properties

Given property are checked only if defined in def file.

Other are ignored and don't fail the validation

Parameters:
array $newPropertyList array of property => new values
Returns:
boolean : true if ALL know value are valid.

Definition at line 323 of file config.class.php.

validate_property ( name,
value 
)

Validate value of a property

Parameters:
string $name
string $value

Definition at line 356 of file config.class.php.


Field Documentation

$backlog

Definition at line 71 of file config.class.php.

$conf_def = array()

Definition at line 56 of file config.class.php.

$conf_def_property_list = array()

Definition at line 65 of file config.class.php.

$conf_dirname = ''

Definition at line 59 of file config.class.php.

$config_code

Definition at line 44 of file config.class.php.

$config_filename

Definition at line 47 of file config.class.php.

$def_dirname = ''

Definition at line 62 of file config.class.php.

$def_filename

Definition at line 50 of file config.class.php.

$def_loaded

Definition at line 74 of file config.class.php.

$md5

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

$property_list = array()

Definition at line 53 of file config.class.php.


The documentation for this class was generated from the following file:
Generated on Tue Jun 8 12:28:38 2010 for Claroline API by  doxygen 1.6.3