Configuration: ezcConfigurationIniWriter
[ ]
[ ]
[ ]
[ ]
[ ]
Class: ezcConfigurationIniWriter
|
This class provides functionality for writing ezcConfiguration objects into INI files. [
source]
A typical usage is to create the writer object and pass the filepath in the constructor:
1. // $conf is an ezcConfiguration object
2. $writer = new ezcConfigurationIniWriter( "settings/site.ini", $conf );
3. $writer->save();
That makes the class figure out the location and name values automatically.
Or generally use the init() function:
1. // $conf is an ezcConfiguration object
2. $writer = new ezcConfigurationIniWriter();
3. $writer->init( "settings", "site", $conf );
4. $writer->save();
This class uses exceptions and will throw them when the conditions for the operation fails somehow.
Parents
ezcConfigurationWriter
|
--ezcConfigurationFileWriter
|
--ezcConfigurationIniWriter
Inherited Member Variables
From
ezcConfigurationFileWriter:
Method Summary
|
protected string |
getSuffix(
)
Returns 'ini'. The suffix used in the storage filename. |
|
protected void |
writeSettings(
$fp, $settings, [$comments = array()] )
Writes the settings and comments to disk |
Inherited Methods
From
ezcConfigurationFileWriter :
From
ezcConfigurationWriter :
Methods
getSuffix
string getSuffix(
)
Returns 'ini'. The suffix used in the storage filename.
Redefinition of
writeSettings
void writeSettings(
resource
$fp,
$settings, [
$comments = array()] )
Writes the settings and comments to disk
This method loops over all groups and settings (defined with the $settings array) and writes those to disk. For the settings itself it will call writeSetting() which also detects arrays and handles those recursively. See ezcConfiguration::$settings and ezcConfiguration::$comments for the formats of those arrays.
Parameters
| Name |
Type |
Description |
$fp |
resource |
The filepointer of the file to write. |
$settings |
array |
The structure containing settings. |
$comments |
array |
The structure containing the comments for the settings. |
Last updated: Mon, 27 Jul 2009