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 PHP
scripts.
--Kris
Hi,
2012/4/13 Kris Craig kris.craig@gmail.com:
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 PHP
scripts.
This may work for LFI issue for new codes.
Few questions.
CLI may use .phpp as PHP script always. (i.e. execute w/o <?php or 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 anE_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
So ok, i write my code in files without extension, what happens?
As it was said before, interpreter will not distinguish by the file
extension, ever. It is os dependant and so on.
Why are you poluting the mailing list with things that are clearly said
will never happen?
On Thu, Apr 12, 2012 at 4:44 PM, Arvids Godjuks arvids.godjuks@gmail.comwrote:
So ok, i write my code in files without extension, what happens?
As it was said before, interpreter will not distinguish by the file
extension, ever. It is os dependant and so on.Why are you poluting the mailing list with things that are clearly said
will never happen?
You might want to consider using less inflammatory, disrespectful language
if you want people to respond favorably to your questions. I.e. accusing
someone of "poluting [sic] the mailing list" because they posted an idea
you don't like is neither constructive nor necessary.
That being said, the .php file extension is not, as far as I know,
determined by the operating system. It's determined by the webserver
configuration. So if you have two different extensions, each with a
separate SAPI handler to differentiate between them, there's no reason why
this wouldn't work just fine. After all, the internet didn't explode when
we dropped the .php3 extension. ;P
Well, I just don't know how i can appeal to common sence to some people on
the list anymore. First the type hinting threads, now this.
The world does not work only on one web server and there are different type
ls of them out there. I for once use nginx and i configure how to run
scripts by locations, not by file types. I just pass the params to fastcgi
server thet runs a php binary. And it does not.care about the extension. I
can use any extension.l for my code. Yes, i use .php, others use. phtml or
other variants. Extensions are just a convension, nothing more. You can
give a file any or none extension at all and it will not change a thing.Ok,
in windows you will not be able to open the file in a program by double
click, but through the open dialog in the app - be my guest. To PHP,
fastcgi and the web server it does not matter. It just matters to people so
they can distingush between a php file, js file and a css file.
13.04.2012 2:01 пользователь "Kris Craig" kris.craig@gmail.com написал:
On Thu, Apr 12, 2012 at 4:44 PM, Arvids Godjuks arvids.godjuks@gmail.comwrote:
So ok, i write my code in files without extension, what happens?
As it was said before, interpreter will not distinguish by the file
extension, ever. It is os dependant and so on.Why are you poluting the mailing list with things that are clearly said
will never happen?You might want to consider using less inflammatory, disrespectful language
if you want people to respond favorably to your questions. I.e. accusing
someone of "poluting [sic] the mailing list" because they posted an idea
you don't like is neither constructive nor necessary.That being said, the .php file extension is not, as far as I know,
determined by the operating system. It's determined by the webserver
configuration. So if you have two different extensions, each with a
separate SAPI handler to differentiate between them, there's no reason why
this wouldn't work just fine. After all, the internet didn't explode when
we dropped the .php3 extension. ;P
On Thu, Apr 12, 2012 at 5:26 PM, Arvids Godjuks arvids.godjuks@gmail.comwrote:
Well, I just don't know how i can appeal to common sence to some people on
the list anymore. First the type hinting threads, now this.
With all due respect, Arvids, get over it. People are going to propose
ideas you don't like. I'm going to propose ideas you don't like. You can
either handle it like a mature adult or you can alienate the very people
you're trying to persuade. I've seen a disturbing pattern of hostile
behavior bordering on abusiveness from you on a number of threads and I
would ask you to take a deep breath and tone it down. If you don't think
you can post a response without engaging in personal attacks and hyperbole,
walk away and come back to it later when you've had a chance to get the
initial emotion out of your system. Spraying the list with insults
whenever someone disagrees with you is not an acceptable way of working
with others IMHO. So please try to work on that.
The world does not work only on one web server and there are different
type ls of them out there. I for once use nginx and i configure how to run
scripts by locations, not by file types. I just pass the params to fastcgi
server thet runs a php binary. And it does not.care about the extension. I
can use any extension.l for my code. Yes, i use .php, others use. phtml or
other variants. Extensions are just a convension, nothing more. You can
give a file any or none extension at all and it will not change a thing.Ok,
in windows you will not be able to open the file in a program by double
click, but through the open dialog in the app - be my guest. To PHP,
fastcgi and the web server it does not matter. It just matters to people so
they can distingush between a php file, js file and a css file.
I'd prefer to avoid getting into a heated argument over something that
amounts to little more than semantics. Yes, file extensions are a
convention by their very nature. And yes, there would need to be some
changes in order to add support for a second parsing type. But you'll
notice that's why I listed the target PHP version as 6.0. A major release
such as that is where one would expect these sorts of fundamental
improvements to be made, plus it gives us a long time to sort out the
technical details since 6.0 won't be coming for at least another few years.
--Kris
13.04.2012 2:01 пользователь "Kris Craig" kris.craig@gmail.com написал:
On Thu, Apr 12, 2012 at 4:44 PM, Arvids Godjuks <arvids.godjuks@gmail.com
wrote:
So ok, i write my code in files without extension, what happens?
As it was said before, interpreter will not distinguish by the file
extension, ever. It is os dependant and so on.Why are you poluting the mailing list with things that are clearly said
will never happen?You might want to consider using less inflammatory, disrespectful
language if you want people to respond favorably to your questions. I.e.
accusing someone of "poluting [sic] the mailing list" because they posted
an idea you don't like is neither constructive nor necessary.That being said, the .php file extension is not, as far as I know,
determined by the operating system. It's determined by the webserver
configuration. So if you have two different extensions, each with a
separate SAPI handler to differentiate between them, there's no reason why
this wouldn't work just fine. After all, the internet didn't explode when
we dropped the .php3 extension. ;P
Hi,
2012/4/13 Arvids Godjuks arvids.godjuks@gmail.com:
So ok, i write my code in files without extension, what happens?
As it was said before, interpreter will not distinguish by the file
extension, ever. It is os dependant and so on.Why are you poluting the mailing list with things that are clearly said will
never happen?
There aren't any clean solution for script only PHP (yet)
There are 3 methods proposed so far.
- php.ini setting that controls embedded-mode
https://wiki.php.net/rfc/nophptags - include/require that loads non-embedded mode
https://wiki.php.net/rfc/source_files_without_opening_tag - file extension that switch to non-embedded mode
https://wiki.php.net/rfc/phpp
All of these have pros and cons.
I prefer mine, but I'll vote +1 for any if one of these
will be accepted.
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net
Hi,
2012/4/13 Kris Craig kris.craig@gmail.com:
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 PHP
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 <?php or 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 anE_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 .phpp,
because it then won't be able to load a template.
David
Hi,
2012/4/13 Kris Craig kris.craig@gmail.com:
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 PHP
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 <?php or 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 anE_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.netThat's a huge WTF that a templating library can't be written as .phpp,
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 from 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.
David
Sorry, but how will i load a template then? I do that in a controller whose
file is.plain php code with no html. Now i'm forced to use some kind of
template engine that does not including a template, but parsing it and
replacing keywords with data? I really do not have to put a sarcastic
phrase here, do i?
13.04.2012 2:05 пользователь "Kris Craig" kris.craig@gmail.com написал:
Hi,
2012/4/13 Kris Craig kris.craig@gmail.com:
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 PHP
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 <?php or
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 anE_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.netThat's a huge WTF that a templating library can't be written as .phpp,
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 from 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.David
On Thu, Apr 12, 2012 at 4:46 PM, David Muir <davidkmuir@gmail.com
mailto:davidkmuir@gmail.com> wrote:> Hi, > > 2012/4/13 Kris Craig <kris.craig@gmail.com <mailto:kris.craig@gmail.com>>: >> 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 PHP >> 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 <?php or 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 <mailto:yohgaki@ohgaki.net> > That's a huge WTF that a templating library can't be written as .phpp, 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
from 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
Hi,
2012/4/13 Kris Craig kris.craig@gmail.com:
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 PHP
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 <?php or 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 anE_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.netThat's a huge WTF that a templating library can't be written as .phpp,
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 from 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 stack.
Problem solved. It's really not as complicated or confusing as you're
making it out to be.
--Kris
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 php
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.
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.
13.04.2012 3:05 пользователь "Kris Craig" kris.craig@gmail.com написал:
On Thu, Apr 12, 2012 at 4:46 PM, David Muir davidkmuir@gmail.com
wrote:Hi,
2012/4/13 Kris Craig kris.craig@gmail.com:
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 PHP
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 <?php or
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 anE_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.netThat's a huge WTF that a templating library can't be written as .phpp,
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 from 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,
DavidIt'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 stack.
Problem solved. It's really not as complicated or confusing as you're
making it out to be.--Kris
2012/4/13 Arvids Godjuks arvids.godjuks@gmail.com:
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 php
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.
Good point.
Although there may be name conflicts, script/script_once would
be better and has more compatibility. Let just make types of
include decided how it behave.
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net
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.13.04.2012 3:05 пользователь "Kris Craig" kris.craig@gmail.com написал:
On 13/04/12 10:04, Kris Craig wrote:
On Thu, Apr 12, 2012 at 4:46 PM, David Muir davidkmuir@gmail.com
wrote:On 13/04/12 09:38, Yasuo Ohgaki wrote:
Hi,
2012/4/13 Kris Craig kris.craig@gmail.com:
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 PHP
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 <?php or
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 anE_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.netThat's a huge WTF that a templating library can't be written as .phpp,
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 from
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,
DavidIt'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 stack.
Problem solved. It's really not as complicated or confusing as you're
making it out to be.--Kris
The meaning is unclear, and it doesn't let you specify error reporting.
Sent from my iPhone
2012/4/13 Arvids Godjuks arvids.godjuks@gmail.com:
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 php
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.Good point.
Although there may be name conflicts, script/script_once would
be better and has more compatibility. Let just make types of
include decided how it behave.Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.netHm, you wrote that you have configured php only with IIS and Apache (any
*nix expirience?). Try nginx, see for yourself how different it is.13.04.2012 3:05 пользователь "Kris Craig" kris.craig@gmail.com написал:
On Thu, Apr 12, 2012 at 4:46 PM, David Muir davidkmuir@gmail.com
wrote:Hi,
2012/4/13 Kris Craig kris.craig@gmail.com:
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 PHP
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 <?php or
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 anE_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.netThat's a huge WTF that a templating library can't be written as .phpp,
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 from
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,
DavidIt'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 stack.
Problem solved. It's really not as complicated or confusing as you're
making it out to be.--Kris
On Thu, Apr 12, 2012 at 6:26 PM, Arvids Godjuks arvids.godjuks@gmail.comwrote:
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 php
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 пользователь "Kris Craig" kris.craig@gmail.com написал:
On Thu, Apr 12, 2012 at 4:46 PM, David Muir davidkmuir@gmail.com
wrote:Hi,
2012/4/13 Kris Craig kris.craig@gmail.com:
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 PHP
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 <?php or
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 anE_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.netThat's a huge WTF that a templating library can't be written as .phpp,
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 from
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,
DavidIt'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 stack.
Problem solved. It's really not as complicated or confusing as you're
making it out to be.--Kris
>
>
> On Thu, Apr 12, 2012 at 5:46 PM, David Muir
>
>
>>
>>
>> On Thu, Apr 12, 2012 at 4:46 PM, David Muir
>>
>>
>> > 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 PHP
>> >> 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
>> <?php or 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 .phpp,
>> 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 from 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 stack. Problem solved. It's really not as complicated or
> confusing as you're making it out to be.
>
> --Kris
>
Both Smarty and Twig compile your template files down to php templates.
Zend_View, Aura.View, and Symfony's php view include php files directly
without a compilation phase.
I don't get how I would write a "simple controller class layer to
operate on top of it".
Does the inclusion limitation apply to just the script in question, or
the entire call stack?
A simplified example:
index.php -> FrontController.phpp -> Controller.phpp -> View.phpp ->
can't include template.phtml
index.php -> FrontController.phpp -> Controller.phpp -> View.php -> can
include template.phtml ?
But I can't do require_once('View.php') in the controller.
If there's an autoloader involved, it would have to be set up in
index.php, and would also have to be .php so that it can include both
file types.
index.php -> FrontController.phpp -> Controller.phpp -> Autoloader.php
-> can include View.php ?
But will that work since there are .phpp files above it in the call stack?
Cheers,
David
Hi,
2012/4/13 Kris Craig kris.craig@gmail.com:
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 PHP
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 <?php or
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 anE_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.netThat's a huge WTF that a templating library can't be written as .phpp,
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 from 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,
DavidIt'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 stack.
Problem solved. It's really not as complicated or confusing as you're
making it out to be.--Kris
Both Smarty and Twig compile your template files down to php templates.
Zend_View, Aura.View, and Symfony's php view include php files directly
without a compilation phase.I don't get how I would write a "simple controller class layer to operate
on top of it".Does the inclusion limitation apply to just the script in question, or the
entire call stack?A simplified example:
index.php -> FrontController.phpp -> Controller.phpp -> View.phpp -> can't
include template.phtmlindex.php -> FrontController.phpp -> Controller.phpp -> View.php -> can
include template.phtml ?
But I can't do require_once('View.php') in the controller.If there's an autoloader involved, it would have to be set up in
index.php, and would also have to be .php so that it can include both file
types.index.php -> FrontController.phpp -> Controller.phpp -> Autoloader.php ->
can include View.php ?But will that work since there are .phpp files above it in the call stack?
Cheers,
David
I'm sorry, I was vague on this point in my previous response. The
controller script would be standard .php, not .phpp. And rather than a
one-dimensional linear progression, there would be parallel stacks, one
.php and the other .phpp, both coming together in the controller (which is
.php).
If I get some time this weekend I'll try to throw together a working
example. Perhaps that'll help clarify my thinking on this. =)
--Kris
Hi,
2012/4/13 Kris Craig kris.craig@gmail.com:
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 PHP
scripts.This may work for LFI issue for new codes.
Few questions.CLI may use .phpp as PHP script always. (i.e. execute w/o <?php or 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?
I'm not sure what the best SAPI configuration would be, but if I had to
throw out an educated guess, I'd say the .phpp extension would just go
through a separate handler. All the code in the file would then be parsed
as PHP, with the added error conditions as described in the RFC. So I
don't anticipate there being any problems once the webserver has been
configured to recognize the new file extension. The files can be included
or accessed directly via HTTP (though in most cases I wouldn't recommend
that from an architectural standpoint, AJAX notwithstanding of course).
A regular .php script cannot be included from a .phpp script. An
E_WARNING
will be thrown for include and anE_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.
Though not necessarily required, my thinking is that that should be ok, so
long as the webserver is configured to know what to do with it of course.
It's conceivable that certain AJAX calls might want to take advantage of
pure scripts, for example.
I cannot tell if this setting is going to be popular, but if it
does, isn't it the end of embedded PHP?
I see no reason why it should be. Embedded PHP will still be there exactly
as it is now; the .php file extension will not be changed by this RFC
whatsoever. As far as whether people will continue using embedded PHP, I
have no idea and I'm guessing there'd probably strong opinions on both
sides of that. This RFC doesn't attempt to address that question, though.
The future of embedded PHP is a separate topic entirely. But my gut
feeling is, so long as there are developers who continue to want it, it'll
still be there for them.
It might be good if PHP is more tolerant for this usage.
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net
Hi,
If we aren't going to consider saving current code risk, then
we could use both new include and file name convention.
Introduce application/x-httpd-php-script, then we could
AddHandler php5-script .php
AddType text/html .php
AddType application/x-httpd-php-source .phps
AddType application/x-httpd-php-script .ph // .phpp .phpc .phpscript
whatever extension here
We may need ENV vars for other SAPIs.
script/script_once for PHP only script includes.
How about this?
--
Yasuo Ohgaki
yohgaki@ohgaki.net
Hi,
If we aren't going to consider saving current code risk, then
we could use both new include and file name convention.Introduce application/x-httpd-php-script, then we could
AddHandler php5-script .php
AddType text/html .php
AddType application/x-httpd-php-source .phps
AddType application/x-httpd-php-script .ph // .phpp .phpc .phpscript
whatever extension here
Yeah that's more or less what I had in mind, actually. There'd be work
involved, no question, but there's no reason why it shouldn't be doable.
We may need ENV vars for other SAPIs.
I'm only familiar with installing PHP on Apache and IIS, so I honestly have
no idea how it would work with other webservers. I'd wager that it's
possible enough, but as for the "how," I'll have to defer to those who have
experience working with said webserver(s).
script/script_once for PHP only script includes.
Would the new "script" keyword behave like include or require? I'm very
wary of the idea of having a special include to treat .php files the same
as .phpp files, simply because it would seem to add a lot of complexity and
potential for confusion, but I won't necessarily rule it out altogether,
either. Right now I'm just working on reassuring those who are afraid this
will cause every single framework on the internet to spontaneously combust
lol.
How about this?
--
Yasuo Ohgaki
yohgaki@ohgaki.net
Hi,
2012/4/13 Kris Craig kris.craig@gmail.com:
Hi,
If we aren't going to consider saving current code risk, then
we could use both new include and file name convention.Introduce application/x-httpd-php-script, then we could
AddHandler php5-script .php
AddType text/html .php
AddType application/x-httpd-php-source .phps
AddType application/x-httpd-php-script .ph // .phpp .phpc .phpscript
whatever extension hereYeah that's more or less what I had in mind, actually. There'd be work
involved, no question, but there's no reason why it shouldn't be doable.We may need ENV vars for other SAPIs.
I'm only familiar with installing PHP on Apache and IIS, so I honestly have
no idea how it would work with other webservers. I'd wager that it's
possible enough, but as for the "how," I'll have to defer to those who have
experience working with said webserver(s).script/script_once for PHP only script includes.
Would the new "script" keyword behave like include or require? I'm very
wary of the idea of having a special include to treat .php files the same as
.phpp files, simply because it would seem to add a lot of complexity and
potential for confusion, but I won't necessarily rule it out altogether,
either. Right now I'm just working on reassuring those who are afraid this
will cause every single framework on the internet to spontaneously combust
lol.
Will it?
As I wrote in other thread, it convenient for backward
compatibility.
function script($file) { return include($file); }
function script_once($file) { return include_once($file); }
It's for new PHP. Why not new keyword.
It's true that people are used file extension convention.
application/x-httpd-php-script and script/script_once for script
only PHP may confuse people. I think it is acceptable, but others
may not.
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net
2012/4/13 Yasuo Ohgaki yohgaki@ohgaki.net:
Hi,
If we aren't going to consider saving current code risk, then
we could use both new include and file name convention.Introduce application/x-httpd-php-script, then we could
AddHandler php5-script .php
AddType text/html .php
AddType application/x-httpd-php-source .phps
AddType application/x-httpd-php-script .ph // .phpp .phpc .phpscript
whatever extension hereWe may need ENV vars for other SAPIs.
script/script_once for PHP only script includes.
How about this?
Forgot to mention CLI.
CLI switch for script only should be included.
Putting all 3 RFC together may work as long as
basic semantics is the same.
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net