Config::writeConfig() – Write container content to datasource


require_once 'Config.php';

mixed Config::writeConfig ( mixed $datasrc = null , string $configType = null , array $options = array() )


This method will call the root Config_Container::writeDatasrc() method which in turn will try to write the Config contents to the datasource.


mixed $datasrc

Datasource to write to

string $configType

Type of configuration for writer

array $options

Options for writer

Return value

mixed - Returns TRUE on success, PEAR_Error on failure.


Possible PEAR_Error values
Error code Error value Meaning Solution


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.

Using writeConfig()

= new Config();
'name' => 'conf')
$config->writeConfig(  '/path/to/file.xml',
'name' => 'conf')

Set content of root Config_container object (Previous) Constructor (Next)
Last updated: Sun, 19 Dec 2010 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report or add a note.
View this page in:

User Notes:

There are no user contributed notes for this page.