From:             pecoes at gmail dot com
Operating system: WinXP
PHP version:      5.0.5
PHP Bug Type:     Feature/Change Request
Bug description:  Adding an optional $directorySeparator parameter to realpath()

Description:
------------
Correct me if I'm wrong, but there doesn't seem to be a single
PHP-function that requires backslashes in pathnames on a Windows-box. They
all work happily with forward slashes. Personally, I have stopped using
backslashes altogether, but there's a single function that's always a
thorn in my side: realpath(). That frequently leads to ugly work-arounds
such as this:

$path = str_replace('\\', '/', realpath($rawpath));

So I'd like to suggest adding an optional $directorySeparator parameter,
that would default to the DIRECTORY_SEPARATOR constant:

$path = realpath($rawpath, '/');

(Actually I'd prefer $directorySeparator to default to '/', but letting it
default to DIRECTORY_SEPARATOR will cause no incompatibilities with
anyone's existing code...)

Hope that makes sense to you :0)

Reproduce code:
---------------
see text

Expected result:
----------------
see text

Actual result:
--------------
see text

-- 
Edit bug report at http://bugs.php.net/?id=35064&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=35064&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=35064&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=35064&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=35064&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=35064&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=35064&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=35064&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=35064&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=35064&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=35064&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=35064&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=35064&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=35064&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=35064&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=35064&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=35064&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=35064&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=35064&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=35064&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=35064&r=mysqlcfg

Reply via email to