php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #27483 debug_backtrace() file information are realpath()ed
Submitted: 2004-03-03 14:23 UTC Modified: 2004-03-03 15:35 UTC
From: icemaze at tiscalinet dot it Assigned:
Status: Wont fix Package: Feature/Change Request
PHP Version: 4.3.4 OS: Gentoo GNU/Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2004-03-03 14:23 UTC] icemaze at tiscalinet dot it
Description:
------------
When I backtrace my program I usually extract file and 
line information to print them on screen. I have my 
webspace in /var/www/localhost/htdocs, so I usually get 
very long filenames. Then I modified my program to strip 
$_SERVER['DOCUMENT_ROOT'] from the path. This is useful 
because you can add "http://www.domain.com/" and get the 
file's URI. 
I also created a symbolic link 
(/var/www/localhost/htdocs/development 
=> /home/icemaze/development) to be able to test my 
subversion tree under Apache. 
And here's the problem: debug_backtrace() returns 
filenames in the following form: 
"/home/icemaze/development/index.php" (i.e. as if they had 
been realpath()ed). This causes problems since I cannot 
strip "DOCUMENT_ROOT" from them. Besides, I don't want to 
strip an arbitrary path from them. 
It would be nice if you could change the behaviour of 
debug_backtrace() so that it returned untranslated paths 
(you can always realpath() them manually if you really 
want to!). Do you think it's possible without too much 
trouble for you? Are there reasons for which things are as 
they are? 
 
Thank you. 


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-03-03 14:27 UTC] derick@php.net
PHP grabs this information from the compiled script which only knows about the realpath'ed files so I'm afraid that it won't be possible to change. Also, debug_backtrace() is just a debug tool and shouldn't really show it's output on production sites, so I kinda fail to see the usefulness of your proposed change. 

Derick
 [2004-03-03 15:35 UTC] icemaze at tiscalinet dot it
I understand. Thank you for your quick reply! ;)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 15 23:01:28 2024 UTC