Re: check if a file is included
| From: | Richard Heyes | Date: | Fri, 12 Sep 2008 12:57:20 +0000 |
| Subject: | Re: check if a file is included | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-279975@lists.php.net to get a copy of this message | ||
> but I would like to know if there is a neater, cleaner, sparkly way of doing
> this.
The way your doing it is fine. You could wrap it up in a custom function, eg:
// True means called directly.
function wasThisFileIncludedOrCalledDirectly ()
{
return strstr($__SERVER["REQUEST_URI"], 'interceptor');
}
Or something like that.
--
Richard Heyes
HTML5 Graphing for IE7, FF, Chrome, Opera and Safari:
http://www.phpguru.org/RGraph