Generic configuration files. The equals, comment start and new line characters in the parser can be customised to match your preferred configuration format.

Available Options
Option Data Type Default value Description
comment string # The character that signifies the start of a comment.
equals string : The character that separates keys from values.
newline string \ The character that signifies that a value continues across multiple lines.

Writing a config file with custom options

require_once 'Config.php';

$conf = new Config();
$root $conf->getRoot();
$root->createComment('Demo config file with GenericConf container');

//GenericConf does not support sections, but section contents are serialized
// into the main config namespace
$dbsect $root->createSection('database');

$r $conf->writeConfig(
'comment' => '#',
'equals'  => '=>',
if (
PEAR::isError($r)) {
$r->getMessage() . "\n";

Generated file

#Demo config file with GenericConf container

Apache (Previous) IniCommented (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.