Re: Re: [RFC] No PHP tags

From: Date: Wed, 12 Feb 2014 01:02:26 +0000
Subject: Re: Re: [RFC] No PHP tags
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-72489@lists.php.net to get a copy of this message
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 <lester@lsces.co.uk> 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 <?php before switching template mode off. How does one
> '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


Thread (37 messages)

« previous php.internals (#72489) next »