Code Comments
Programming Forum and web based access to our favorite programming groups.Hi- I would like to leverage the capabilities of the Config package to edit some config.inc.php file programmatically. I would like to use the Config package rather than PHPs parse_ini_file because I want to be able to insert, update, and delete configuration data. This is a standard type of PHP config file that is very widely used. Format is straightforward ike this: // comment comment $var1 = "blah"; $var2 = "blahblah"; $var3 = "blahblahblah"; All of us have seen this type of file before. But I have hit a roadblock because the documentation on the PEAR site for the Config package is very unclear. Many of the examples seem not to be up to date and are inconsistent with one another. The tutorial on devshed that is suggested as a good starting point seems to be several years old and the examples there no longer match what is on the PEAR site (in terms of objects, methods, etc.) I have tried to implement just a rudimentary example using parseConfig, and I am getting the following error: "File 'config.inc.php' does not contain a required 'conf' array" Yet nowhere (that I could see) is it explained what a "conf array" is. In fact, there is no explanation for what types of parameters are even acceptable to pass to parseConfig. You can see what I mean here (http://pear.php.net/manual/en/packa...fig.php ) Is there a practical example anywhere or an up-to-date tutorial that someone could point me toward? Any assistance appreciated. Thanks. -Kush P.S.- I searched through the mail archives and found quite a few people asking this same question, but I didn't see any definitive explanation, although one person (I think on the PEAR dev team) suggested hacking out a solution in PHP instead of using the Config package, so I would really appreciate it if someone could let me know if the Config package is simply buggy and should be avoided so I do not keep beating my head against a wall here :)
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.