note 63166 deleted from function.get-included-files by danbrown

From: Date: Sun, 20 Jul 2008 00:04:45 +0000
Subject: note 63166 deleted from function.get-included-files by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-141821@lists.php.net to get a copy of this message
Note Submitter: gamblor at crazyhomer dot com ---- In regards to __FILE__ != $_SERVER['SCRIPT_FILENAME'] to check for a file as an include: This only works if you are using PHP as an Apache module; when using PHP as a CGI binary on shared hosts, the filepaths may differ, even if they end up pointing to the exact same file. For example, __FILE__ might be /home/SERVER/USER/SITE/test.php and $_SERVER['SCRIPT_FILENAME'] might be /home/USER/SITE/test.php Because of the SERVER included in the __FILE__ path, the comparison returns true, even though the file is not being included by any other file.

« previous php.notes (#141821) next »