Re: Re: Question about superglobals
| From: | Sam Barrow | Date: | Sat, 17 Nov 2007 03:57:19 +0000 |
| Subject: | Re: Re: Question about superglobals | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-33196@lists.php.net to get a copy of this message | ||
I agree, I wouldn't want to create a class just for one variable to be
in it. It works, yes, but it's just not the clean way to do things. Why
not allow maximum flexibility?
On Fri, 2007-11-16 at 20:26 -0700, Michael McGlothlin wrote:
> So the idea now is to inappropriately force everything to be a class?
> >> Yes, and in even larger scale applications it can become even more
> >> useful. I have a web framework I'm working on, it's about 9,500 lines of
> >> code now with hundreds of functions/classes. Every function/method has
> >> to specify global for my 3 universal variables which contain large
> >> arrays of configuration information. With this, I can say "superglobal
> >> $mod, $sec, $cfg" in my root include file, and not worry about it again.
> >
> > class Config {
> > const FOO = "Bar";
> > }
> >
> > function oink() {
> > if (Config::FOO == 'Bar') {
> > echo "OINK";
> > }
> > }
> >
> > etc.
> > IMO, you really don't need more superglobals.
> >
> > S
>
>
> --
> Michael McGlothlin
> Southwest Plumbing Supply
>