Using PEAR::Config with ini files

From: Date: Thu, 23 Sep 2004 21:29:47 +0000
Subject: Using PEAR::Config with ini files
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-14622@lists.php.net to get a copy of this message
Hello, I am using PEAR::Config and I run into some troubles with the infile container. My test script just reads the information from a ini file and writes it back. <?php include_once 'PEAR.php'; include_once 'Config.php'; $cfg = new Config(); $root =& $cfg->parseConfig('test.ini','inifile'); $cfg->setRoot($root); $ret =& $cfg->writeConfig('test.ini', 'inifile'); if ( PEAR::isError($ret) ) { print $ret->getMessage()."\n"; } else { print "OK\n"; } ?> Should all work out ok, but the original file looks like this: [Application] defaultModule=DirectoryLister debug=12 [Caching] enable=1 backend=shm and the altered one like this: [root] [Application] defaultModule=DirectoryLister debug=12 [Caching] enable=1 backend=shm with a [root] section added. Is this expected behaviour? Thanks, Robert _______________________________________________________________ Connex scaneaza automat toate mesajele impotriva virusilor folosind Trend Micro VirusWall. Connex automatically scans all messages for viruses using Trend Micro VirusWall. _______________________________________________________________ Nota: Este posibil ca produsul Trend Micro VirusWall sa nu detecteze toti virusii noi sau toate variantele lor. Va rugam sa luati in considerare ca exista un risc de fiecare data cind deschideti fisiere atasate si ca MobiFon nu este responsabila pentru orice prejudiciu cauzat de decizia dvs. Disclaimer: It is possible that the Trend Micro VirusWall product may not be able to detect all new viruses and variants. Please be aware that there is a risk involved whenever opening e-mail attachments to your computer and that MobiFon is not responsible for any damages caused by your decision to do so.

« previous php.pear.general (#14622) next »