#46260 [NEW]: __FILE__ should not resolve symlink paths
From: bugs dot php dot net at callum-macdonald dot com
Operating system: Linux
PHP version: 5.2.6
PHP Bug Type: Feature/Change Request
Bug description: __FILE__ should not resolve symlink paths
Description:
------------
See these bugs:
http://bugs.php.net/bug.php?id=38790
http://bugs.php.net/bug.php?id=42516
http://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 bug report at http://bugs.php.net/?id=46260&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=46260&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=46260&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=46260&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=46260&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=46260&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=46260&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=46260&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=46260&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=46260&r=support
Expected behavior: http://bugs.php.net/fix.php?id=46260&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=46260&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=46260&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=46260&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46260&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=46260&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=46260&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=46260&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=46260&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=46260&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=46260&r=mysqlcfg
Thread (18 messages)
- bugs dot php dot net at callum-macdonald dot com
- luke_phpbugs at dashjr dot org#46260 [Com]: __FILE__ should not resolve symlink paths
- bugs dot php dot net at callum-macdonald dot com#46260 [Com]: __FILE__ should not resolve symlink paths
- raphael dot roulet at univ-st-etienne dot fr#46260 [Com]: __FILE__ should not resolve symlink paths
- glideraerobatics at hotmail dot com#46260 [Com]: __FILE__ should not resolve symlink paths
- miguel-php at cr dot uz#46260 [Com]: __FILE__ should not resolve symlink paths
- rix at mindginative dot comReq #46260 [Com]: __FILE__ should not resolve symlink paths
- jimmy at powerzone dot dkReq #46260 [Com]: __FILE__ should not resolve symlink paths
- php at micropro dot czReq #46260 [Com]: __FILE__ should not resolve symlink paths
- gnoodl+php at gmail dot comReq #46260 [Com]: __FILE__ should not resolve symlink paths
- tony at brown dot orgReq #46260 [Com]: __FILE__ should not resolve symlink paths
- nars at clix dot ptReq #46260 [Com]: __FILE__ should not resolve symlink paths
- monsen dot dag at gmail dot comReq #46260 [Com]: __FILE__ should not resolve symlink paths
- bugs dot php dot net at callum-macdonald dot comReq #46260 [Com]: __FILE__ should not resolve symlink paths
- contato at mesotec dot com dot brReq #46260 [Com]: __FILE__ should not resolve symlink paths
- sdbondi at gmail dot comReq #46260 [Com]: __FILE__ should not resolve symlink paths
- alex at wordnik dot comReq #46260 [Com]: __FILE__ should not resolve symlink paths
- pajoye@php.netReq #46260 [Opn->Dup]: __FILE__ should not resolve symlink paths