Class initialization using ini file
| From: | daniel dot garcia at assertio dot es | Date: | Mon, 05 May 2003 05:52:52 +0000 |
| Subject: | Class initialization using ini file | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-5223@lists.php.net to get a copy of this message | ||
Hi,
As a PEAR newbie user, I found different approaches to initializa the
classes: Some are initialized passing variables as constructor parameters,
while others can use an .ini file (which can be overriden when the class
is instantiated). I find that using an .ini file is very convenient, since
all the class initialization parameters can be in one separate file, and
all the classes can be initialized with a loop (e.g. with the nice
technique found in
http://devel.akbkhome.com/peardoc2/package.html.html-template-flexy.configuration.html).
In order to use the "ini file technique" for other classes that don't
allow it, the only way I can think of is the class being extended, with
the initialization being handled in that extended class. If anyone can
think of a better approach, I'd like very much to hear it.
Just some thoughts...
-- Daniel