note 20134 deleted from language.constants by danbrown

From: Date: Tue, 26 Jul 2011 20:06:39 +0000
Subject: note 20134 deleted from language.constants by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-181917@lists.php.net to get a copy of this message
Note Submitter: alan at akbkhome dot com ---- 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);

« previous php.notes (#181917) next »