Re: Config class
| From: | Bertrand Mansion | Date: | Thu, 25 Jul 2002 14:14:02 +0000 |
| Subject: | Re: Config class | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-7983@lists.php.net to get a copy of this message | ||
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.
That's correct. But looking at the Config source, I found that there is a
writeInput method : this means that Config also works on files. There is
even a 'preserve' parameter which is supposed to let Config know if the
parameter has to be preserved when writeInput is called. BTW, this doesn't
seem to be implemented yet.
If I want Config to handle configuration datasource (you can call them
containers if you want, I don't see the difference), I will need to change
the structure of the data array. IMO, it was a design mistake in the first
place to mix all the key/value pairs from different datasource into just one
array ($data) without distinguishing them by their source. There is no way
to know where the key/value pair comes from. How can you use a writeInput
method then ? That sounds impossible.
So what do you suggest ?
Bertrand Mansion
Mamasam