Configuration: ezcConfigurationArrayWriter
[ ]
[ ]
[ ]
[ ]
[ ]
Class: ezcConfigurationArrayWriter
|
This class provides functionality for writing ezcConfiguration object into files containing PHP arrays. [
source]
The file it writes to will be a PHP file containing the group and comments (if enabled).
A typical usage is to create the writer object and pass the filepath in the constructor:
1. $writer = new ezcConfigurationArrayWriter( "settings/site.php" );
2. $writer->setConfig( $configurationObject );
3. $writer->save();
That makes the class figure out the location and name values automatically.
This class uses exceptions and will throw them when the conditions for the operation fails somehow.
Files are required to have the suffix .php, as this allows PHP accelerators to cache the content for even faster retrieval.
Parents
ezcConfigurationWriter
|
--ezcConfigurationFileWriter
|
--ezcConfigurationArrayWriter
Inherited Member Variables
From
ezcConfigurationFileWriter:
Method Summary
|
protected string |
getSuffix(
)
Returns the suffix used in the storage filename. |
|
protected static void |
writeSettings(
$fp, $settings, [$comments = array()] )
Writes the settings and comments to disk |
Inherited Methods
From
ezcConfigurationFileWriter :
From
ezcConfigurationWriter :
Methods
getSuffix
string getSuffix(
)
Returns the suffix used in the storage filename.
Redefinition of
writeSettings
void writeSettings(
resource
$fp, array
$settings, [array
$comments = array()] )
Writes the settings and comments to disk
This method loops over all groups and settings and write those to disk. For the settings itself it will call writeSetting() which also detects arrays and handles those recursively.
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: Thu, 01 Nov 2007