Edit report at https://bugs.php.net/bug.php?id=47785&edit=1

 ID:                 47785
 Updated by:         krak...@php.net
 Reported by:        andre at webkr dot de
 Summary:            get_included_files resolves symlinks
-Status:             Open
+Status:             Closed
 Type:               Feature/Change Request
-Package:            Feature/Change Request
+Package:            *General Issues
 Operating System:   Linux
 PHP Version:        5.2.9
-Assigned To:        
+Assigned To:        krakjoe
 Block user comment: N
 Private report:     N

 New Comment:

Symlinks are resolved to their full paths because it's the only sensible thing 
to do.

If your application requires the relative path, it should be no problem to 
discover it, being that if the path of the application is relevant information 
then you should have it in a variable/constant somewhere.

This is a non-issue.


Previous Comments:
------------------------------------------------------------------------
[2009-03-29 02:52:58] andre at webkr dot de

It's even worse:
When an included file includes another file using a relative path, that is 
looked up in the target directory of the symlink!

It should be relative to the path where the symlink resides. The only access 
types that should treat the symlink in a special way are unlink (it should 
remove the symlink, not the target file) and chmod (it should do nothing). All 
other access types (especially the read involved here) should see the symlink 
as if it were a file with the content and attributes of the target file.

------------------------------------------------------------------------
[2009-03-26 04:04:41] andre at webkr dot de

Description:
------------
When a symlink is included/required, get_included_files shows the target of the 
symlink. Together with Bug #46260 this makes it completely impossible to 
determine how the file was really called when it was included.

Reproduce code:
---------------
include('path_to/a_symlink.php');
var_dump(get_included_files());

Expected result:
----------------
An array containing a string "[...]/path_to/a_symlink.php".

Actual result:
--------------
An array containing a string "[...]/some_file.php".


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=47785&edit=1

Reply via email to