in a script i call another class with:
Factory::folder();
but when i specify...
dirname(__FILE__)
...i get the library's path, not the caller's.
how can i have the caller's path?
thanks
in a script i call another class with:
Factory::folder();
but when i specify...
dirname(__FILE__)
...i get the library's path, not the caller's.
how can i have the caller's path?
thanks
Do this,
$trace = debug_backtrace();
echo $trace[1]['file']
You can even go back further.
Use ReflectionClass. To be more specific, it's method getFileName().