note 20134 added to language.constants

From: Date: Sat, 23 Mar 2002 14:08:39 +0000
Subject: note 20134 added to language.constants
Groups: php.notes 
Request: Send a blank email to php-notes+get-28122@lists.php.net to get a copy of this message
The __FILE__ constant in 4.2rc1 (CLI) will return the location of script specified to be run, rather than the absolute file. eg. /usr/bin/phpmole (a softlink to /usr/lib/php/phpmole/phpmole.php) started like this bash#/usr/bin/phpmole the line echo __FILE__ in phpmole.php will output /usr/bin/phpmole - in the CGI it would have returned /usr/lib/php/phpmole/phpmole.php the workaround is to check for links!! $f = __FILE__; if (is_link($f)) $f = readlink($f); -- http://www.php.net/manual/en/language.constants.php http://master.php.net/manage/user-notes.php?action=edit+20134 http://master.php.net/manage/user-notes.php?action=delete+20134 http://master.php.net/manage/user-notes.php?action=reject+20134

« previous php.notes (#28122) next »