require_once 'Config.php';
mixed Config::writeConfig ([mixed $datasrc = NULL [, string $configType = NULL [, array $options = array()]]])
mixed Config::writeConfig
This method will call the root Config_Container::writeDatasrc() method which in turn will try to write the Config contents to the datasource.
Datasource to write to
Type of configuration for writer
Options for writer
mixed - Returns TRUE on success, PEAR_Error on failure.
Table 31-1. Possible PEAR_Error values
This function can not be called statically.
This example shows how to convert a configuration from a php file which contains a php array to an xml file.
Example 31-1. Using writeConfig()
$config = new Config(); $config->parseConfig( '/path/to/file.php', 'phparray', array('name' => 'conf') ); $config->writeConfig( '/path/to/file.xml', 'xml', array('name' => 'conf') );