Bug #12203 Updated: Inconsistent __FILE__ contents when using require/require_once
| From: | derick@php.net | Date: | Tue, 18 Jun 2002 10:27:05 +0000 |
| Subject: | Bug #12203 Updated: Inconsistent __FILE__ contents when using require/require_once | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-11108@lists.php.net to get a copy of this message | ||
ID: 12203
Updated by: derick@php.net
Reported By: adam@iewebs.com
-Status: Analyzed
+Status: No Feedback
Bug Type: Scripting Engine problem
Operating System: Linux
PHP Version: 4.1.0
New Comment:
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
Previous Comments:
------------------------------------------------------------------------
[2001-12-14 14:43:18] yohgaki@php.net
I think __FILE__ is better to set filename that is requested.
Status = Analyzed
------------------------------------------------------------------------
[2001-12-12 08:21:13] yohgaki@php.net
PHP Version update
------------------------------------------------------------------------
[2001-12-12 07:02:26] yohgaki@php.net
On my linux with 4.1.0, __FILE__ has always actual /path/to/file. (i.e.
not pathname of sym link, but pathname linked to) It does not ommit
path, though.
I think __FILE__ should have pathname for sym link instead of pathname
linked to...
Is this correct behavior? Anyone?
------------------------------------------------------------------------
[2001-07-17 08:20:14] adam@iewebs.com
Not sure if this is a bug or a feature, or what the correct result
should be, but...
Related to bug #6636, require_once() and include_once() used on a soft
link will result in the __FILE__ constant containing only the filename
of the link, whereas include() and require() will result in __FILE__
containing the full path and filename of the linked file.
ln -s /path/to/file.php /path/to/link.php
CASE ONE:
require_once('/path/to/link.php');
// returns 'link.php'
echo __FILE__;
CASE TWO:
require('/path/to/link.php');
// returns '/path/to/file.php'
echo __FILE__;
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=12203&edit=1