On Thu, 2008-06-19 at 17:31 +0300, Sancar Saran wrote:
> Hi tedd
>
> My final solution was.
>
> class conf {
>
> public static $vals = array(); // config array
> ...
> }
>
> conf::$vals['mysql_host'] = 'localhost';
> conf::$vals['mysql_user'] = "[EMAIL PROTECTED]";
>
> you can access anywhere of your script and you won't need to pollute $GLOBALS.
Technically, you've polluted global class namespace with a class called
"conf". I wonder how many others have made a class called conf? Good
thing namespaces are coming along eventually :)
Admittedly though, the class implementation is more robust since it
could pull it's config information from anywhere. However, it's also
less efficient.
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php