note 113736 added to language.constants.predefined
| From: | skoobiedu at gmail dot com | Date: | Fri, 22 Nov 2013 20:38:00 +0000 |
| Subject: | note 113736 added to language.constants.predefined | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-197622@lists.php.net to get a copy of this message | ||
__DIR__ is actually equivalent to realpath(dirname(__FILE__)).
Here's a modified version of the one-liner eyecatchup at gmail dot com[1] wrote:
<?php
// ensure the __DIR__ constant is defined for PHP 4.0.6 and newer
(@__DIR__ == '__DIR__') && define('__DIR__',
realpath(dirname(__FILE__)));
?>
Their version also works on PHP 4.0.6, but doesn't use realpath. __DIR__ is an absolute path to
the current file.
[1] http://www.php.net/manual/en/language.constants.predefined.php#113233
----
Server IP: 72.52.91.14
Probable Submitter: 72.52.91.14
----
Manual Page -- http://php.net/manual/en/language.constants.predefined.php
Edit -- https://master.php.net/note/edit/113736
Del: integrated -- https://master.php.net/note/delete/113736/integrated
Del: useless -- https://master.php.net/note/delete/113736/useless
Del: bad code -- https://master.php.net/note/delete/113736/bad+code
Del: spam -- https://master.php.net/note/delete/113736/spam
Del: non-english -- https://master.php.net/note/delete/113736/non-english
Del: in docs -- https://master.php.net/note/delete/113736/in+docs
Del: other reasons-- https://master.php.net/note/delete/113736
Reject -- https://master.php.net/note/reject/113736
Search -- https://master.php.net/manage/user-notes.php