Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:72489 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 64494 invoked from network); 12 Feb 2014 01:03:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Feb 2014 01:03:10 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.51 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.215.51 mail-la0-f51.google.com Received: from [209.85.215.51] ([209.85.215.51:39129] helo=mail-la0-f51.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F8/91-55284-D48CAF25 for ; Tue, 11 Feb 2014 20:03:09 -0500 Received: by mail-la0-f51.google.com with SMTP id c6so6473004lan.38 for ; Tue, 11 Feb 2014 17:03:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=QxtbNuyhfx06fYcI1dyqheD+WdTsQjBQDyFrLtcyLdE=; b=SVpa/hg1TA1J1lkSaPDjW1dlbOo2u5H7idAwX+sZrZAYGp8xlrkLKi4r7T9495gCdp /DwDrygybYjKPdpiDYt7RE1H5hLAL578cJXQ5WL41yhBiJK85DK4WCA/AouWWIuLqQVl w8PVZH3XfHuaTK9yJhHD+da2r8OQSZ+CM5Rj+UFGLyQQtfEZw3q6ilxgyCa5qYTxNeTB Mj9qlZedf4q4GK2SGa2DVms/zGoM6DTdz80mmanswCXdTvGSGmPuLxujyszqfixcyjhF R7Br1AMp2DgpEY/egN5ZdVnlW0GhAEtw/T770H4iJxWYL0NXStq/qLMPAlO66iI/tnh9 15Bg== X-Received: by 10.112.99.74 with SMTP id eo10mr27231872lbb.15.1392166986300; Tue, 11 Feb 2014 17:03:06 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.112.199.37 with HTTP; Tue, 11 Feb 2014 17:02:26 -0800 (PST) In-Reply-To: <52FAB58E.3080701@lsces.co.uk> References: <52FA67A4.3030708@lerdorf.com> <52FAB58E.3080701@lsces.co.uk> Date: Wed, 12 Feb 2014 10:02:26 +0900 X-Google-Sender-Auth: tg6Sk9MU2L1LrdOpnEd9kK1Xfmw Message-ID: To: Lester Caine Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a11346d7cafc2ac04f22b22d1 Subject: Re: [PHP-DEV] Re: [RFC] No PHP tags From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a11346d7cafc2ac04f22b22d1 Content-Type: text/plain; charset=UTF-8 Hi Lester, I think the RFC is too long, so I'll reorganize it. Old contents remains as reference to that people could understand past discussions. On Wed, Feb 12, 2014 at 8:43 AM, Lester Caine wrote: > Yasuo Ohgaki wrote: > >> I like the way PHP works. Embedded script nice for web applications and we >> should not drop it, but it's better for security if it is restricted to >> only where it is needed. >> > > OK Re-reading the whole RFC ... it is all about 'template_mode' being used > to switch tag handling on and off? PHP 'Open' tag being optional seems to > be secondary? > > ------------------ > function render_template($template, $template_vars) { > ini_set('template_mode', 'on); // Older PHP ignores > // Do what ever required as template > ini_set('template_mode', 'off'); // Older PHP ignores > } > ------------------ > > When switching on template_mode what actually happens? Is it actually in > PHP mode so that you have to add a ?> before loading raw html and then > 'close' with a 'include' a raw html file with embedded PHP? The include needs to be in PHP > space, but needs to open the file in html mode? Template mode may be specified only when PHP is started, IMO. (INI_SYSTEM) Current RFC is INI_ALL, though. If users would like to use template_mode=on, they use include()/require() as usual. This is simpler than current RFC. User may do for any PHP version. function render_template($template, $template_vars) { include($template); } Anyway, current RFC allows template_mode=off/of at anytime, and it should not change include()/require() behavior at all. That's the reason why I propose script()/script_once() for script only include, and it should not change behavior depends on template_mode. Does this answer to you? I'll reorganize the RFC from now. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a11346d7cafc2ac04f22b22d1--