ID: 46260
Comment by: luke_phpbugs at dashjr dot org
Reported By: bugs dot php dot net at callum-macdonald dot com
Status: Open
Bug Type: Feature/Change Request
Operating System: Linux
PHP Version: 5.2.6
New Comment:
$_SERVER["PHP_SELF"] helps a little.
Previous Comments:
------------------------------------------------------------------------
[2008-10-09 01:32:07] bugs dot php dot net at callum-macdonald dot com
Description:
------------
See these bugs:
http://bugs.php.net/bug.php?id=38790http://bugs.php.net/bug.php?id=42516http://bugs.php.net/bug.php?id=37603
The __FILE__ constant should not, in my opinion, resolve symbolic links
on *nix operating systems. At the very least, there should be an option
to control this behaviour.
Because __FILE__ returns only the symlink resolved path, there is no
way to get the symlink path of the currently included file. If __FILE__
returned the symlinkpath, the resolved path could be retrieved with
realpath(__FILE__).
The opposite is not true. There is no way to go from the resolved path
to the original link path. I realise this is a feature not a bug, but I
believe it is a serious shortcoming and limits the ability of PHP in
symlinked situations.
Reproduce code:
---------------
See http://bugs.php.net/bug.php?id=37603
Expected result:
----------------
__FILE__ should return the symlink path
Actual result:
--------------
__FILE__ returns the resolved path
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=46260&edit=1