Re: Config class

From: Date: Thu, 25 Jul 2002 15:13:17 +0000
Subject: Re: Config class
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-7988@lists.php.net to get a copy of this message
le 25/07/02 16:50, Bertrand Mansion à bmansion@mamasam.com a écrit : > le 25/07/02 15:32, Alexander Merz à alexander.merz@t-online.de a écrit : > >> Bertrand Mansion wrote: >> >> >>> Yes, I would like to add methods for delete, add, replace lines in config >>> files. Presently, configuration parameter lines are not stored in the data >>> array, I would like to add that. >> >> This is not directly Config related, what you want is something like >> File_Passwd, which directly works on a file - Config works on >> 'containers'. Such a container can base on a Package like File_Passwd. > > I found some other design problems in the Config class: > > The container classes, ex: IniFile.php or even the dummy container class, > don't have a constructor but you pass parameters to these classes as if they > had one. Is this a normal behaviour ? > > The container instance variable is not declared in Config.php before its > first use. > > I have thought about your statement here above and actually, the Config > class I am working on doesn't belong to the File category as it should also > handle various DB containers. Two more things: I've had problems with duplicate keys in config files. Sometimes, they are here on purpose. With the current implementation of Config.php, when keys are present two times in the config file, they are overwritten. My implementation tries to keep them. In some config files, a '\' character before the end of line means that the following line reports to the parameter defined in the previous line. I take care of this too. Just some ideas, Bertrand Mansion Mamasam PS: good to see the DOC v2. Thanks. :-)

« previous php.pear.dev (#7988) next »