On Mon, 2003-10-06 at 06:22, Tom Rogers wrote:
> >> 
> >> Well I must have missed that one :)
> >> My answer, if GLOBALS were not meant to be used they wouldn't be there..
> >> So if they make life easier go ahead and use them. I notice a lot of 'purists'
> >> on this list that want things done a certain way but the bottom line is do what
> >> your comfortable with and works for you. Of course you have to keep security
> >> issues under control as well, it would be no good doing this if you run with
> >> register globals set to on as the array could very easily be trashed.
> 
> RC> All fine and dandy till you decide to use some other class or library
> RC> that just happened to use the same global names you've used. Then you
> RC> have a mess :) But sure, if that's not an issue, go ahead and globalize
> RC> everything.
> 
> No one was suggesting globalising everything :)
> 

I was! If the global issue isn't an issue, and you really feel like
using globals, and you are comfortable with using them, and you don't
ever expect conflicts then go ahead and use them :) Its almost
impossible not to use at least one, unless you use a function as the
entry point to your code, in which case the name of the function has all
of the same issues. Personally I use a single array withing the global
scope to hold any necessary global configuration data. For example:

    $GLOBALS['interJinn']['pageCompression'] = true;

This minimizes the chance of conflict IMHO.

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to