note 113736 deleted from language.constants.predefined by peehaa
| From: | peehaa@php.net | Date: | Mon, 22 May 2017 07:25:17 +0000 |
| Subject: | note 113736 deleted from language.constants.predefined by peehaa | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-209084@lists.php.net to get a copy of this message | ||
Note Submitter: skoobiedu at gmail dot com
----
__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