Hi,

2012/4/10 Luke Scott <l...@cywh.com>:
> On Apr 9, 2012, at 6:22 PM, Kris Craig <kris.cr...@gmail.com> wrote:
>
> If the default is "template mode" and the "<?php" tag is optional (at the
>> top) in "code" mode there shouldn't be any problems.
>>
>> We don't need to change or leave out the tag entirely.
>>
>> Is there a problem with people being able to choose "template mode" or
>> "code mode" as the default in the php.ini file if "template mode" is the
>> default if not specified?
>>
>
> I think so, yes.  A config option that causes massive BC breakage doesn't
> become ok simply because it defaults to current behavior.  I just can't
> envision any situation in which having that option switched on would not
> cause problems, unless that server is *only* running scripts that assume
> code mode.  However, what if you want to use two scripts, but one assumes
> code and the other assumes HTML?  The ini_set() function would be pretty
> much useless given the circumstances.
>
> Instead, I would have an optional <?phpp tag at the top of the file.  This
> would be in addition to the file extension/SAPI approach and the require
> keyword approach.  In other words, perhaps an "all of the above" strategy
> is what's neeeded here.  But either way, I just don't think an INI setting
> would be feasible.
>
> --Kris
>
>
> Ini_set wouldn't work for this anyway. It would have to be changeable only
> in php.ini.

Please don't repeat mistakes for allow_url_include or allow_url_include.
If admin would like to enforce programmer not to change php.ini.
They should use Apache httpd and admin_flag/admin_value.

Programmers should have as much control as possible to be
creative. Optional embedded mode is one of them. There are
too many thing that programmers should worry. If it can be turned
off, they are free from it.

Regards,

--
Yasuo Ohgaki
yohg...@ohgaki.net


>
> Are you concerned a shared host us going to force code mode? Because
> regardless of the default mode you can still do something like:
>
> include "/foo/bar.php", INC_TEMPLATE;
>
> If the php.ini option really spooks you, perhaps it can be specified by the
> web server as an environmental variable.
>
> In my case all requests (besides /public/* - purely static files) are feed
> directly to index.php. I'd like to specify the mode in my Nginx config for
> that index.php file.
>
> Luke

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to