Can I get the path of the PHP file originally called within an included file?
path, php
Solution
Wouldn't this get you the directory of the running script more easily?
$dir=dirname($_SERVER["SCRIPT_FILENAME"])
Problem
Let's say we have `index.php` and it is stored in `/home/user/public/www` and `index.php` calls the class `Foo->bar()` from the file `inc/app/Foo.class.php`. I'd like the bar function in the `Foo` class to get a hold of the path `/home/user/public/www` in this instance — I don't want to use a global variable, pass a variable, etc.