Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:59700 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 33145 invoked from network); 11 Apr 2012 02:11:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Apr 2012 02:11:01 -0000 Authentication-Results: pb1.pair.com smtp.mail=kris.craig@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=kris.craig@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.170 as permitted sender) X-PHP-List-Original-Sender: kris.craig@gmail.com X-Host-Fingerprint: 74.125.82.170 mail-we0-f170.google.com Received: from [74.125.82.170] ([74.125.82.170:58826] helo=mail-we0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 67/99-18401-338E48F4 for ; Tue, 10 Apr 2012 22:11:00 -0400 Received: by werh12 with SMTP id h12so303246wer.29 for ; Tue, 10 Apr 2012 19:10:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=tke/Z+1MSW+tb21dmL3YuuQZvituCMHdvIgLulYq5tc=; b=d7xTyjuo6INildDS1KkRvqNxiWYs9SiaRUKkEPPy4btZkkA7j9LG1BW8cCRof16SFG ErlaReueePIHOFHFMV4Pe3qo4Oi2efd6xdi3vfBiKEVkFA7ZMqYteTIwrLeD9/s2sUYo dqNnsAR5d6E3hFRylP7BO69+KBsMCXCI05U8GF8CPackCnydlIqOvZgoTSamO3mXls8A ASpsgm/OGHx8ecw/Brug9TRa2+ZgvFW9THeptVIecz0ah8kcgXq+1cK+cJm3BWL5r/5r 2cICg9eUmsjsJBjg+c9Rbmx3abQdT5Np9hYHMhQ+Pztq21eyu6GPBQ1fGr9CdS0dJ6B5 /z8g== MIME-Version: 1.0 Received: by 10.180.81.166 with SMTP id b6mr2329783wiy.0.1334110257012; Tue, 10 Apr 2012 19:10:57 -0700 (PDT) Received: by 10.223.79.67 with HTTP; Tue, 10 Apr 2012 19:10:56 -0700 (PDT) In-Reply-To: References: Date: Tue, 10 Apr 2012 19:10:56 -0700 Message-ID: To: Tom Boutell Cc: PHP Internals Content-Type: multipart/alternative; boundary=f46d0442811ef5df7904bd5dbf96 Subject: Re: [PHP-DEV] UPDATED RFC version 1.1: source files without opening wrote: > On Tue, Apr 10, 2012 at 7:59 PM, Kris Craig wrote: > > Tom, > > > > Much better, though I'm still very troubled by allowing non-pure PHP > code to > > be mixed-in with pure PHP (by means of includes). The problem I have > with > > this, as a developer, is that this means I can't really trust that what I > > will get from a "pure PHP" script will actually be pure PHP, because > > non-pure scripts lower in the stack might mix-in HTML code that would > then > > get passed up through the stack. These really shouldn't be mixed > anyway, so > > I'm just not seeing any value in not keeping this separation consistent. > > The approach you suggest would make it impossible to load an existing > library of perfectly good classes from a newer framework. I don't know > anyone who would be able to get work done under those circumstances (: > It would lead to almost no adoption of the new feature. > This *shouldn't* be used to load libraries that dump raw HTML output! That literally defeats the entire purpose. You're also assuming that all PHP developers do 100% of their coding through pre-existing frameworks. If you're including a library that contains embedded HTML, you should do so from a regular .php file. Then you can include the .phpp file at that same level, thereby avoiding the collision. For example, here's what you're suggesting: -------------- (Main Script) ------------ | | | | [Included .php/HTML Script] {Included .phpp Script} | | [Included .php/HTML Script from Framework/Library] That approach is bad architecture and simply unnecessary. If you want to interface with that library, do it like this instead: (Main Script) | | [Included .php/HTML Script] | | | | {Included .phpp Script} [Included .php/HTML Script from Framework/Library] In other words, instead of calling that third-party, HTML-containing library from the .phpp file, call both it and the .phpp file from a regular .php file, which will then act as the "controller" and bridge the functionality between the two. This would be a far more *sane* architecture, anyway. And it allows you to achieve the exact same result, without having to have included HTML bits polluting the upstream from the pure PHP stack. Make sense? I'm just not seeing any value in breaking this model just so that bad, lazy architecture that shouldn't be used in the first place can be supported. > Whereas if we make this feature easy to adopt, and strict within the > files it does apply to, then over time we would see more and more > .phpp and less and less .php. Mission accomplished. Sometimes a > realistic compromise is the long term way to get to a better place. > > Think through what will likely happen in the real world under various > proposals, and not just what would be most pure (: > See above. =) > > -- > 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 > > --f46d0442811ef5df7904bd5dbf96--