|
Posted by Alan Little on 10/28/29 11:47
Carved in mystic runes upon the very living rock, the last words of
Chung Leong of comp.lang.php make plain:
> Alan Little wrote:
>> I'm just surprised that whoever thought of the __FILE__ constant
>> didn't think to make this one as well, both for reasons of
>> reliability and security.
>
> It's not that surprising if you consider the architecture. PHP is
> consisted of the PHP framework and the Zend engine. __FILE__, along
> with __CLASS__, and __FUNCTION__, live in application-agnostic Zend
> land. The information they hold is readily already to the language
> parser. PHP_SELF on the other hand has to live in PHP-SAPI land, since
> that's information from the web server. It's possible to implement
> what you described, but then we would end up with cross-talk between
> components that are supposed to be independent.
OK, that makes sense. I guess I hadn't fully thought out the thing I was
wishing for. For the things I've used it for, I haven't been interested
so much in the URL path as in the file name, which of course is knowable
internally. A construct like __FILE__ which would hold the name of the
main script, with or without filesystem or URL path info, would be
useful.
> Again, __FILE__ is not a constant. It's a language construct. Its value
> changes--unlike a constant.
Terminology corrected. Thanks.
--
Alan Little
Phorm PHP Form Processor
http://www.phorm.com/
Navigation:
[Reply to this message]
|