Config::writeConfig

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

Synopsis

require_once 'Config.php';

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

Description

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

Parameter

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.

Throws

Possible PEAR_Error values
Error code Error value Meaning Solution
  "    

Note

This function can not be called statically.

Example

This example shows how to convert a configuration from a php file which contains a php array to an xml file.

Using writeConfig()

<?php
$config 
= new Config();
$config->parseConfig(
                       
'/path/to/file.php',
               
'phparray',
                       array(
'name' => 'conf')
            );
$config->writeConfig(  '/path/to/file.xml',
                       
'xml',
                       array(
'name' => 'conf')
            );
?>
Set content of root Config_container object (Previous) Config_Container class (Next)
Last updated: Sat, 16 Feb 2019 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report.
View this page in:
  • English

User Notes:

There are no user contributed notes for this page.