Hi,
I'd love to see a realpath() replacement function which makes use of the stat cache for partial paths as well. Chances are that on a busy ISP server, for example, you will have thousands of scripts and include files served up from the same base path and you are going to be statting your way along that tree every time you hit a file that isn't in the cache.
It is a very good idea to replace realpath() with an own function. Realpath is not only slow, it is also "dangerous" on some systems like linux where it also works on paths that are not really existing.
example: include "./foo/bar/index.php/../../../../../../etc/passwd";
On the BSDs this should be invalid, but linux happily accepts it as
/etc/passwd. This is just one thing that would largely benefit from an own realpath().
Stefan
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php