Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:59841 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65321 invoked from network); 13 Apr 2012 01:46:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Apr 2012 01:46:32 -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 209.85.212.182 as permitted sender) X-PHP-List-Original-Sender: kris.craig@gmail.com X-Host-Fingerprint: 209.85.212.182 mail-wi0-f182.google.com Received: from [209.85.212.182] ([209.85.212.182:58327] helo=mail-wi0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B4/C2-00290-775878F4 for ; Thu, 12 Apr 2012 21:46:31 -0400 Received: by wibhr14 with SMTP id hr14so2266932wib.11 for ; Thu, 12 Apr 2012 18:46:28 -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=9dP1jzWArdFE7vMc6LNQQlyFfDQbx2qZ5yLcjqAwNeo=; b=prOci++NMSb4xg/Q2uWg9e0EGOLpKOpVQLwMUrIO4I95t54FTchMFowt5iJowF4cZ/ L/4+UMK+sMiJSN5EczFlvKm39ZIJ851k5EIxppJcUJEtsmkQs8g95onTLNvS2P5y1+mt 27+i9IGzSaqvI1yj+SeicSApe7FI1XWO4mKHuYOjEPjqtur8/tHgkLDHuJlZIbcvSfNc kOHuDSg5/q2NkS5KCgg5WiRiLlRI1WlXuyH+lCh4mxt8j511/bWTuiP8849qwbrOUKVj 0qC7lQPSJ7N4tkKgrR/qkCTo1fCsYtLV3xu3SI+el9GyQj04qoAhhyKZAI4sQ9OVUBHr jM0A== MIME-Version: 1.0 Received: by 10.180.103.35 with SMTP id ft3mr588232wib.0.1334281588258; Thu, 12 Apr 2012 18:46:28 -0700 (PDT) Received: by 10.223.79.67 with HTTP; Thu, 12 Apr 2012 18:46:28 -0700 (PDT) In-Reply-To: References: <4F876943.8030105@gmail.com> <4F877777.8050806@gmail.com> Date: Thu, 12 Apr 2012 18:46:28 -0700 Message-ID: To: Arvids Godjuks Cc: PHP internals list , Yasuo Ohgaki , David Muir Content-Type: multipart/alternative; boundary=f46d043bd7e81937c404bd85a489 Subject: Re: [PHP-DEV] [RFC] New .phpp File Type for Pure-Code PHP Scripts From: kris.craig@gmail.com (Kris Craig) --f46d043bd7e81937c404bd85a489 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable On Thu, Apr 12, 2012 at 6:26 PM, Arvids Godjuks w= rote: > Well, i can say that any template engine that is not a pure php extension > does template inclusion via an include of a file with html and embedded p= hp > code. Because to make things fast you have to convert your templates from > tags and pseudo code to that state and cache the result so not to make > parsing on every request. > > And right now there is a standard for autoloading the libraries and > frameworks that most big players agreed on, that will make loading of 3rd > party stuff easy. Untill one converts to pphp and other does not. > Autoloadijg will just break because of mixed approaches. > The autoloading standard is still more or less in its infancy IMHO; the MVC standard, on the other hand, has been around for awhile and is widely accepted. I haven't done any detailed work with the autoloading standard, but I'll look into it. I can't imagine though that it would be so inflexible as to make it completely incompatible with existing MVC standards. If that was the case, then I can't imagine ever wanting to use that, anyway. > Hm, you wrote that you have configured php only with IIS and Apache (any > *nix expirience?). Try nginx, see for yourself how different it is. > You are aware that Apache runs on both Windows and Linux, right? It's the "A" in "LAMP", after all. ;P > 13.04.2012 3:05 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 "Kris Craig" =CE=C1=D0=C9=D3=C1=CC: > > On Thu, Apr 12, 2012 at 5:46 PM, David Muir wrote: >> >> > On 13/04/12 10:04, Kris Craig wrote: >> > >> > >> > >> > On Thu, Apr 12, 2012 at 4:46 PM, David Muir >> wrote: >> > >> >> On 13/04/12 09:38, Yasuo Ohgaki wrote: >> >> > Hi, >> >> > >> >> > 2012/4/13 Kris Craig : >> >> >> Per recent discussions, I have drafted an RFC for this. This >> proposal >> >> >> offers what I believe to be a more sane and realistic approach to >> >> >> addressing the question of incorporating a new breed of tag-less P= HP >> >> >> scripts. >> >> >> >> >> >> https://wiki.php.net/rfc/phpp >> >> > This may work for LFI issue for new codes. >> >> > Few questions. >> >> > >> >> > CLI may use .phpp as PHP script always. (i.e. execute w/o > else) >> >> > It's like DOS, though. >> >> > >> >> > How do you enforce .phpp as script only for Web? >> >> > Is it a rule for configuration? or .phpp just never supposed to >> locate >> >> > under docroot? >> >> > It relates previous question. How about bootstrap script for >> frameworks? >> >> > >> >> >> A regular .php script cannot be included from a .phpp script. An >> >> E_WARNING will be thrown for include and an E_RECOVERABLE_ERROR will = be >> >> thrown for require; in both instances, the included file will be >> ignored. >> >> > Some people may try to make .phpp handled by web. >> >> > I cannot tell if this setting is going to be popular, but if it >> >> > does, isn't it the end of embedded PHP? >> >> > It might be good if PHP is more tolerant for this usage. >> >> > >> >> > Regards, >> >> > >> >> > -- >> >> > Yasuo Ohgaki >> >> > yohgaki@ohgaki.net >> >> > >> >> >> >> That's a huge WTF that a templating library can't be written as .php= p, >> >> because it then won't be able to load a template. >> >> >> > >> > That's actually not true. Please refer to the diagram embedded in the >> RFC. >> > >> > Basically, you can load a template just fine-- you just can't do it >> > directly from a .phpp file, which you shouldn't be doing, anyway. The >> > .phpp file is, at least for the most part, intended to be included fro= m >> a >> > regular .php file, which also would include whatever you're using for >> your >> > templates. In other words, they can interact just fine; you just can'= t >> put >> > the template upstream from a .phpp file in the include stack-- which, >> > again, you really shouldn't be doing, anyway, as it's just bad >> architecture. >> > >> > >> > >> > How is this bad architecture? Every framework I've seen that has some >> kind >> > of templating layer that handles the scope and inclusion of the >> template, >> > and it happens further down the chain from the controlling code. >> > >> > Zend_View, Twig or Smarty would have to remain as .php and not .phpp, >> > otherwise they wouldn't be able to render the templates. >> > >> > In the case of Zend Framwork, which I'm most familiar with, the >> > application, front controller, dispatcher, and action controllers, and >> some >> > services would have to remain as .php so that templates could be >> executed. >> > >> > Oh, and the autoloader can't be .phpp either. But then if it's .php, >> then >> > the autoloader can't be called from .phpp files to include .php files. >> > >> > Cheers, >> > David >> > >> >> It's been awhile since I've used Smarty, but unless my memory is failing >> me, I'm pretty sure it's not restricted to being several points removed >> upstream as you described. I'm not familiar with Zend_View or Twig so I >> can't comment on those. >> >> Thing is, there's no reason why you can't hook any framework into this. >> Worst-case scenario, if the library you're hooking into has a rigid >> structure, just write a simple controller class layer to operate on top = of >> it, then use that same controller class to interface with the .phpp stac= k. >> Problem solved. It's really not as complicated or confusing as you're >> making it out to be. >> >> --Kris >> > --f46d043bd7e81937c404bd85a489--