From: fb at fbeyer dot com
Operating system: Any
PHP version: Irrelevant
PHP Bug Type: Feature/Change Request
Bug description: __DIR__ - Another 'magic constant'
Description:
------------
It would be extremely handy to extend the 'magic constant' family by
__DIR__ - a constant poining to the directory where the current file is
located, ending with a directory separator slash.
__DIR__ could be defined in user-land by
<?php
// Defined as constant - so it won't be usable for
// other files...
define('__DIR__', dirname(__FILE__) . DIRECTORY_SEPARATOR);
// Use __DIR__
require __DIR__ . 'another-file-for-this-library.php';
?>
Many scripts (e.g. SMARTY_DIR) already define variables/constants for this
purpose. __DIR__ would be a nice feature to write include_path independent
scripts.
--
Edit bug report at http://bugs.php.net/?id=28040&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=28040&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=28040&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=28040&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=28040&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=28040&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=28040&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=28040&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=28040&r=support
Expected behavior: http://bugs.php.net/fix.php?id=28040&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=28040&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=28040&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=28040&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28040&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=28040&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=28040&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=28040&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28040&r=float