Is it possible to detect when php file is included?
<p>So in file <code>first.php</code> I will include file <code>original.php</code> with <code>include_once</code>.</p>

<p>Problem occurs, when I try to call functions which are inside <code>original.php</code> and that file is not loading if there is no user session.</p>

<p>Basicaly I'm include file <code>original.php</code> in which are few functions im calling later in <code>first.php</code>, but those functions are inaccesible due to restrictions I've set in <code>original.php</code>, but now I want to add rule to <code>original.php</code> to allow such requests from <code>first.php</code> or any other PHP file that will include <code>original.php</code>...</p>

<p>I wonder what could I do in this case OR could I simply add some if clause to <code>original.php</code>, like:</p>

<pre><code>if($fileIncluded == 'yes')
{
   // do not check if user session exist etc.
}
else
{
   // check for user session
}
</code></pre>

<p>Thanks for ideas and help in advance!</p>
