php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #16459 way to get *actual* filename code is in (include() breaks available methods)
Submitted: 2002-04-05 19:07 UTC Modified: 2002-04-05 19:17 UTC
From: olli at ukgamer dot net Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 4.1.2 OS: Win*/Slackware
Private report: No CVE-ID: None
 [2002-04-05 19:07 UTC] olli at ukgamer dot net
There doesn't appear to be a way to get the filename of code that is currently executing. 

Eg. echo $SCRIPT_FILENAME; or echo $PHP_SELF; 
works fine in most situations, but as soon as the file containing this code is included in another, they start to return the filename of the includING file. (not the includED one).

I understand this generally goes against the purpose of include() but this functionality would be very useful. 

Thanks

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-05 19:17 UTC] olli at ukgamer dot net
Sorry, i missed the constant "__FILE__".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC