Re: HELP - Config Package

From: Date: Fri, 25 Apr 2003 08:36:29 +0000
Subject: Re: HELP - Config Package
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-5057@lists.php.net to get a copy of this message
<andre.lourenco@link.pt> wrote : > Hi, > I have this config file (type = 'phparray'); > > <?php > $conf['db']['type'] = "mysql"; > $conf['db']['host'] = "localhost"; > $conf['db']['port'] = "3306"; > $conf['db']['user'] = "user"; > $conf['db']['pass'] = "pass"; > $conf['db']['name'] = "configuration"; > $conf['app']['install-language'] = "english"; > $conf['app']['language'] = "portuguese"; > ?> > > And i want to change $conf['app']['install-language'] to > "whatever". > > Note: I can read and write the configuration file using the config > package. > And i have all the packages updated. Look here, I've written some docs (incomplete)... http://www.appelsiini.net/~tuupola/php/peardoc2/package.configuration.html Look at getItem() and setContent(). BTW, as this is a php array, you can also change the value directly in the array: Include('arrayfile.php'); $conf['app']['install-language'] = "portuguese"; $config = new Config(); $config->parseDatasrc($conf, 'phparray'); $config->writeConfig('arrayfile.php', 'phparray'); Bertrand Mansion Mamasam

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