Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:59424 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38207 invoked from network); 7 Apr 2012 16:04:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Apr 2012 16:04:39 -0000 Authentication-Results: pb1.pair.com header.from=tom@punkave.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=tom@punkave.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain punkave.com designates 209.85.161.170 as permitted sender) X-PHP-List-Original-Sender: tom@punkave.com X-Host-Fingerprint: 209.85.161.170 mail-gx0-f170.google.com Received: from [209.85.161.170] ([209.85.161.170:46383] helo=mail-gx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 01/1A-23111-695608F4 for ; Sat, 07 Apr 2012 12:04:39 -0400 Received: by ggmb2 with SMTP id b2so1721459ggm.29 for ; Sat, 07 Apr 2012 09:04:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=subject:references:from:content-type:x-mailer:in-reply-to :message-id:date:cc:content-transfer-encoding:mime-version :x-gm-message-state; bh=u25jf1Tp+J5rtXgJPokFAk+uI3Nz+6nV0M6JzgzaYfY=; b=CwsVYh4SiDGEGSiNSCiV/FamWIZL9BotHTYObZocLZDkA8gx7/wASdxNXqnd3saCdy B/R3AwTCAI25bt3T/WODOYIgPiwUe53kWrnCFgzh+GHm4dmXKGYFjGm4juUrPtDzYxEV OTv/tZcyaUWQ7nDCAErW6h15b3qVjDg2vRxHP13joHJFVzX7l27iOx85zgD4wLx26+1I gdhukdXHyraolj3+SLAXMTq9BF0S7Y5Si8QFWUck3XzGuCCJDaKM9TLE9Qboh90LZcaM tZeZC0RIzQJz0BdkYls648hppMg7Jcdf9VIo4MJoAg8EmFTZedSuD5iz4UfvIAg8sdvz zVdw== Received: by 10.101.151.6 with SMTP id d6mr414536ano.82.1333814674471; Sat, 07 Apr 2012 09:04:34 -0700 (PDT) Received: from [10.193.212.26] (mobile-166-147-108-033.mycingular.net. [166.147.108.33]) by mx.google.com with ESMTPS id 34sm17497420anu.6.2012.04.07.09.04.31 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 07 Apr 2012 09:04:33 -0700 (PDT) References: <03FFDCA3-90B2-48CA-B102-7562E0E9CA45@zort.net> <7019423255875772333@unknownmsgid> Content-Type: text/plain; charset=us-ascii X-Mailer: iPhone Mail (9B176) In-Reply-To: <7019423255875772333@unknownmsgid> Message-ID: <93A21C4E-C811-4D2A-9304-6DDF1E8994FB@punkave.com> Date: Sat, 7 Apr 2012 12:04:23 -0400 Cc: PHP Internals Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (1.0) X-Gm-Message-State: ALoCoQkZ61vSUljla27daQFuVQAuX7CmmPIpYqIaMYiy1pAksc1KYb62K+y4N9r0WArByL4DMtCB Subject: Re: [PHP-DEV] PHP class files without wrote: > On Apr 7, 2012, at 7:00 AM, Tom Boutell wrote: >=20 >> That's a good point too. >>=20 >> I think this is a better proposal: >>=20 >> include_code, require_code, and require_code_once would work just like >> include, require and require_once, except that the parser would start >> out in PHP mode. >>=20 >> .phpc is then just a convention for naming PHP files that start out >> with code - a convention that autoloaders should respect, just as they >> now respect the .php convention. "The user asked for the Monkey class, >> and I see Monkey.phpc is out there; I'll grab that with >> require_code_once." >>=20 >> Putting this decision on the autoloader makes more sense because >> autoloaders already contain assumptions about file extensions. They >> have to in order to do their job of translating a class name to a >> particular path somewhere. >>=20 >> Folks who did not care for this functionality could then choose to >> entirely ignore it. Class library developers who liked it would make >> autoloaders available that honored it, freeing end-user developers >> from thinking about it. It becomes self-contained, and people who are >> writing old-school .php standalone scripts or pages are entirely >> unaffected. >=20 > Tony I think your idea has some merit. If it were up to me I'd remove > =20 > But I feel that adding new keywords is not the way to do it. > Personally I'd like to see a php.ini setting to disallow the ending ?> > tag and assume .php files just have PHP code. The starting would be optional. White space would be ignored and non-white space > characters before =20 > Doing it this way would disallow bad practices but still make existing > PHP scripts compatible. >=20 > I think that doing that would be quite reasonable. Those who complain > about it likely ignore industry best practices anyway. This option > could be turned off by default at first, made default later, and then > ?> be deprecated all together. >=20 > So with this option enabled ?> is forbidden, the text before text before throws an error (unless it's a shebang line in cli mode). >=20 > Hopefully that made sense. Does this sound good to you? >=20 > I'm sorry you had to endure such a nasty troll. I am so sick of self > righteous bullies who think they know it all. >=20 > Luke >=20 >>=20 >> On Sat, Apr 7, 2012 at 9:50 AM, John Bafford wrote: >>>=20 >>> On Apr 7, 2012, at 09:39, Tom Boutell wrote: >>>=20 >>>>> =46rom the viewpoint of someone writing reusable classes, the need to >>>> start with >>> above it is a silly annoyance they don't experience with other tools. >>>>=20 >>>> That said, you are making valid points, I'm not convinced myself that >>>> "file extensions" necessarily should or could be determined in every >>>> context. But it seems the most viable way of addressing the issue - if >>>> a viable way even exists. Partly I want to convince myself that this >>>> either can or can't ever be improved, and move on either way (: >>>=20 >>> That "silly annoyance" doesn't seem to bother anyone who writes command l= ine tools, which require the #! line specifying the command interpreter to b= e the first bytes in the file, with no leading white space whatsoever. Espec= ially on unix systems (but also on the Mac), the file extension does not aff= irmatively indicate the file type or whether or not it can be executed. >>>=20 >>> Also, from a CLI perspective, you don't want extensions in the names of y= our scripts, because then it causes problems/confusion/extra work if you lat= er decide to change the language the script is written in. >>>=20 >>> -John >>>=20 >>> -- >>> John Bafford >>> http://bafford.com/ >>>=20 >>>=20 >>> -- >>> PHP Internals - PHP Runtime Development Mailing List >>> To unsubscribe, visit: http://www.php.net/unsub.php >>>=20 >>=20 >>=20 >>=20 >> -- >> Tom Boutell >> P'unk Avenue >> 215 755 1330 >> punkave.com >> window.punkave.com >>=20 >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php >>=20