Class MagratheaConfigFile
Magrathea Config loads and saves information in config files.
Methods summary
public
|
|
public
itself
|
#
setPath( string $p )
Set the path to the confi file
Set the path to the confi file
Parameters
Returns
itself
|
public
itself
|
#
setConfig( array $c )
Sets the config information
Sets the config information
Parameters
Returns
itself
|
public
itself
|
#
setFile( string $filePath )
Sets the name of the config file
Sets the name of the config file
Parameters
- $filePath
- Name of the config file
Returns
itself
|
public
boolean
|
#
createFileIfNotExists( )
Creates the configuration file if it doesn't exists. And saves it.
Creates the configuration file if it doesn't exists. And saves it.
Returns
boolean True if the file exists; Return of Save() function if it doesn't
|
public
string/int/array
|
#
getConfig( string $config_name = "" )
Gets configuration
Parameters
- $config_name
Configuration to be got. If empty, returns all the configuration into the file
If an acceptable config name, returns its value
Returns
string/int/array If $config_name is empty, returns all the configuration. Otherwise,
Todo
exception 704 on key does not exists
|
public
array
|
#
getConfigSection( string $section_name )
Gets a full config section
Gets a full config section
Parameters
- $section_name
- Name of the section to be shown
Returns
array All the values of the given section
Todo
exception 704 on key does not exists
|
public
boolean
|
#
Save( boolean $save_sections = true )
Saves the config file
Parameters
- $save_sections
A flag indicating if the sections should be saved also.
Default: true
Returns
boolean True if the saved succesfully. False if got any error in the process
|
Magic methods summary