Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:59422 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 34661 invoked from network); 7 Apr 2012 15:46:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Apr 2012 15:46:34 -0000 Authentication-Results: pb1.pair.com smtp.mail=luke@cywh.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=luke@cywh.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain cywh.com from 209.85.220.170 cause and error) X-PHP-List-Original-Sender: luke@cywh.com X-Host-Fingerprint: 209.85.220.170 mail-vx0-f170.google.com Received: from [209.85.220.170] ([209.85.220.170:48507] helo=mail-vx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 04/69-23111-951608F4 for ; Sat, 07 Apr 2012 11:46:33 -0400 Received: by vcbfo14 with SMTP id fo14so1388603vcb.29 for ; Sat, 07 Apr 2012 08:46:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=references:from:in-reply-to:mime-version:date:message-id:subject:to :cc:content-type:content-transfer-encoding:x-gm-message-state; bh=hLg7y5a0Ua21IaTVIgP8T7y+/s+XP11GwpTOOrNB0aw=; b=BJWo+1oyq3CctvNZEJkOJaZ/HhA2JMGw1WDjdOovsyJeJfsvfWp63A/+xqisUjZ6bB XIICRN9CPY7rvdz8oN/D6Ys2JVIADMp8wymz2/nxNsodd8IqrFBllnMlC7hn/93TVHIU wvNGmypUu+Y67NkzVa7lNFNOlGJrib5tiHFNey1PdgIstT706yPxtpLT3fY68s8fJsj+ BTGoho6rfmGGpidSr866caDC3iBJw506bTeBUmb3dyAn+PcdMqkkmlSIE9ATrC0zBW6/ 7/ZOGfgmXB4kyB1WuE+XApG8PXNLgZpJfc/22sFJru7+ED+WMOcPNxo7qAO/4G3OpDxP sbAw== Received: by 10.220.141.84 with SMTP id l20mr822037vcu.31.1333813589648; Sat, 07 Apr 2012 08:46:29 -0700 (PDT) References: <03FFDCA3-90B2-48CA-B102-7562E0E9CA45@zort.net> In-Reply-To: Mime-Version: 1.0 (1.0) Date: Sat, 7 Apr 2012 08:46:27 -0700 Message-ID: <7019423255875772333@unknownmsgid> To: Tom Boutell Cc: PHP Internals Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQkVt/VtutEbvJxW/bp7Hfto5aqagg2B5A/MG0ku0MiAhn3YgSDtmVXGwUzdAsQGqqRfYnXM Subject: Re: [PHP-DEV] PHP class files without wrote: > That's a good point too. > > I think this is a better proposal: > > 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. > > .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." > > 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. > > 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. Tony I think your idea has some merit. If it were up to me I'd remove tag and assume .php files just have PHP code. The starting be deprecated all together. So with this option enabled ?> is forbidden, > On Sat, Apr 7, 2012 at 9:50 AM, John Bafford wrote: >> >> On Apr 7, 2012, at 09:39, Tom Boutell wrote: >> >>>> From 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. >>> >>> 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 (: >> >> That "silly annoyance" doesn't seem to bother anyone who writes command = line tools, which require the #! line specifying the command interpreter to= be the first bytes in the file, with no leading white space whatsoever. Es= pecially on unix systems (but also on the Mac), the file extension does not= affirmatively indicate the file type or whether or not it can be executed. >> >> Also, from a CLI perspective, you don't want extensions in the names of = your scripts, because then it causes problems/confusion/extra work if you l= ater decide to change the language the script is written in. >> >> -John >> >> -- >> John Bafford >> http://bafford.com/ >> >> >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php >> > > > > -- > Tom Boutell > P'unk Avenue > 215 755 1330 > punkave.com > window.punkave.com > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >