Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:33196 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 12627 invoked by uid 1010); 17 Nov 2007 03:57:22 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 12612 invoked from network); 17 Nov 2007 03:57:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Nov 2007 03:57:22 -0000 Authentication-Results: pb1.pair.com smtp.mail=sam@sambarrow.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=sam@sambarrow.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain sambarrow.com from 205.234.132.11 cause and error) X-PHP-List-Original-Sender: sam@sambarrow.com X-Host-Fingerprint: 205.234.132.11 scottsdale.servershost.net Received: from [205.234.132.11] ([205.234.132.11:36014] helo=scottsdale.servershost.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2F/79-51194-1A66E374 for ; Fri, 16 Nov 2007 22:57:21 -0500 Received: from [216.15.51.211] (port=50754 helo=[192.168.1.90]) by scottsdale.servershost.net with esmtpsa (SSLv3:RC4-MD5:128) (Exim 4.68) (envelope-from ) id 1ItEo5-0005Bs-QA; Fri, 16 Nov 2007 21:57:21 -0600 To: Michael McGlothlin Cc: Sean Coates , internals@lists.php.net In-Reply-To: <473E5F4F.2020508@swplumb.com> References: <8D.46.01128.768AD374@pb1.pair.com> <1195246391.21084.15.camel@sbarrow-desktop> <1195250285.4012.6.camel@johannes.nop> <1195251014.21084.20.camel@sbarrow-desktop> <473E349E.3050704@swplumb.com> <1195259494.10547.2.camel@sams-room> <0E6C7DB2-4126-4660-A813-E21C03045247@caedmon.net> <473E5F4F.2020508@swplumb.com> Content-Type: text/plain Date: Fri, 16 Nov 2007 22:57:19 -0500 Message-ID: <1195271839.12249.0.camel@sams-room> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Content-Transfer-Encoding: 7bit X-Antivirus-Scanner: Clean mail though you should still use an Antivirus X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - scottsdale.servershost.net X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - sambarrow.com X-Source: X-Source-Args: X-Source-Dir: Subject: Re: [PHP-DEV] Re: Question about superglobals From: sam@sambarrow.com (Sam Barrow) 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 >