Question

Is there any way to determine from within a required script, where that require call was made from?

So if Script B is required by Script A. How can I determine from within Script B that it is Script A who is making the request?

Was it helpful?

Solution

debug_backtrace might help you.

OTHER TIPS

a $_SERVER['PHP_SELF'] in scripr B, will show the current file (script A)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top