In PHP, how can I get info about the file originating a function call?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/3330938/php-how-do-i-know-the-caller-of-a-function">PHP: how do I know the caller of a function ?</a>  </p>
</blockquote>



<p>If I have a file named <strong>file1.php</strong> with the following code:</p>

<pre><code>// file1.php

file2_func();
</code></pre>

<p>And then I have another file named <strong>file2.php</strong> with the following code:</p>

<pre><code>// file2.php    

function file2_func() {
  // define info about the file calling me
}
</code></pre>

<p>If I call the function <code>file2_func()</code> from code written in <strong>file1.php</strong>, is there any way for <code>file2_func()</code> to be aware of that. Specifically I want do define a variable within <code>file2_func()</code> that stores the file path of <strong>file1.php</strong>.</p>

<p>Any ideas?</p>
