Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:59911 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85327 invoked from network); 13 Apr 2012 20:02:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Apr 2012 20:02:41 -0000 X-Host-Fingerprint: 208.107.13.98 host-98-13-107-208.midco.net Date: Fri, 13 Apr 2012 16:02:41 -0400 Received: from [208.107.13.98] ([208.107.13.98:12962] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B6/A1-11739-066888F4 for ; Fri, 13 Apr 2012 16:02:41 -0400 Message-ID: To: internals@lists.php.net References: <4F876943.8030105@gmail.com> <4F877777.8050806@gmail.com> <4F8782CC.8030205@gmail.com> <13.6A.35770.615388F4@pb1.pair.com> User-Agent: slrn/pre1.0.0-18 (Linux) X-Posted-By: 208.107.13.98 Subject: Re: [PHP-DEV] [RFC] New .phpp File Type for Pure-Code PHP Scripts From: weierophinney@php.net (Matthew Weier O'Phinney) On 2012-04-13, Kris Craig wrote: > --f46d04447f47ae95ec04bd949e5f > Content-Type: text/plain; charset=ISO-8859-1 > > On Fri, Apr 13, 2012 at 12:12 PM, John Crenshaw wrote: > > > > > > > > > On top of this, there's an argument that you're not addressing: most > > > > template engines in PHP either directly consume PHP template files... > > > > or "compile" templates into... PHP template files. As such, sooner or > > > > later, you'll have a class that includes a PHP template file, and > > > > that's where things break for me in this proposal. > > > > > > > > > > They don't break because nobody in their right mind would ever try to > > > include a .phpp file in a framework like that. If its stack is so > > entangled, > > > the very notion of a pure PHP stack is just incompatible. So your best > > bet > > > on a framework like that would be to stick with .php. > > > > Um, so if you aren't using any form of template engine whatsoever, what > > are you proposing? You're saying we should all go back to the good ol' C > > days of trying to put together valid markup using string concatenation? (Or > > worse, manipulation of DOM classes?) No thanks. IMO this is a bit like > > blowing up London to stop a jaywalker. > > > > That's a logical fallacy; i.e. your contention relies on the premise that, > if this doesn't work with every single framework known to exist, then it > doesn't work with any template engine whatsoever. That's just patently > ridiculous and could not be further from the truth. Then point to ONE widely used, OSS templating engine or MVC framework that will be able to operate as pure PHP. (My mustache library does not count.) I'll give you time to look for one. Hint: I don't think you'll find any. Most PHP template engines compile templates to HTML with embedded PHP. This does NOT mean that including such a PHP file immediately spits out output -- on the contrary: every PHP templating engine I've seen by default will use output buffering to allow capturing the output to a variable, which you _later_ spit out. This is one reason I'm very uncertain about your assertion that including an embedded PHP file taints the class including it, as well as any up the stack. The code itself is never really operating in "mixed" or "embed" mode -- only the template file itself is. If you insist on the tainting aspect, I honestly do not see this proposal gaining ground; few if any exising frameworks or template engines will gain anything by it, much less be able to take advantage of it, and the work necessary to make it possible makes it undesirable, except as an achievement ("look! I did it!"). Finally, you're constantly dismissing the arguments that specifying a specific suffix is a bad idea -- but without making a reasonable argument as to why suffixes are okay. I personally write a lot of CLI scripts in PHP -- and typically do not give them extensions. Under your proposal, even those these do not operate in embed mode, because they do not have the "blessed" extension, they cannot omit the