Re: include_once 'Config_File.class.php'
| From: | Cynic | Date: | Wed, 20 Jun 2001 21:52:17 +0000 |
| Subject: | Re: include_once 'Config_File.class.php' | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-910@lists.php.net to get a copy of this message | ||
Hi there,
yep, this is a good reason to stay away from __FILE__, at least
until 4.0.7 isn't out. :)
BTW, I just checked the the behavior of __FILE__ wrt. completness
of the path (the files are almost identical, file2.php is included
from file1.php):
[cynic@freepuppy bin]$ ./file1.php
This is file1.php
__FILE__: ./file1.php
dirname(__FILE__): .
dirname(realpath(__FILE__)): .
This is file2.php
__FILE__: /usr/home/cynic/bin/file2.php
dirname(__FILE__): /usr/home/cynic/bin
dirname(realpath(__FILE__)): /usr/home/cynic/bin
[cynic@freepuppy bin]$ uname -a
FreeBSD freepuppy.infosite.cz 4.3-STABLE FreeBSD 4.3-STABLE #0: Wed Jun 20 09:13:31 CEST 2001
cynic@freepuppy.infosite.cz:/usr/obj/usr/src/sys/FREEPUPPY i386
At 21:57 6/20/2001, Monte Ohrt wrote the following:
--------------------------------------------------------------
>Here is one:
>
>http://marc.theaimsgroup.com/?l=smarty&m=99107548713181&w=2
>
>Andrei Zmievski wrote:
>>
>> On Wed, 20 Jun 2001, Cynic wrote:
>> > Andrei,
>> >
>> > do you remember which PHP versions / systems / combinations
>> > of thereof you saw __FILE__ contain just the basename? This
>> > should be track down and resolved, because it is a bug, or
>> > at least a serious misfeature. (But I admit that the manual
>> > is really confusing: "The name of the script file presently
>> > being parsed." So is it full name incl. path or just the
>> > basename?)
>>
>> No, I don't remember what it was. It might be that top level executed
>> file is fine but files it includes mess up __FILE__ constant..
>>
>> -Andrei
>> * If it's never finished, you can't prove it doesn't work. *
>>
>> ---
>> You are currently subscribed to smarty as: monte@ispi.net
>> To unsubscribe send a blank email to $subst('Email.Unsub')
>> Visit Smarty's homepage at
>> http://www.phpinsider.com/php/code/Smarty/
>
>--
>Monte Ohrt <monte@ispi.net>
>http://www.ispi.net/
------end of quote------
cynic@mail.cz
-------------
And the eyes of them both were opened and they saw that their files
were world readable and writable, so they chmoded 600 their files.
- Book of Installation chapt 3 sec 7