Bug #77639 [Com]: Wrong behavior of getting paths for symlink

From: Date: Tue, 19 Feb 2019 19:26:29 +0000
Subject: Bug #77639 [Com]: Wrong behavior of getting paths for symlink
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-219643@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77639&edit=1 ID: 77639 Comment by: mesaverde228 at gmail dot com Reported by: mesaverde228 at gmail dot com Summary: Wrong behavior of getting paths for symlink Status: Feedback Type: Bug Package: *Directory/Filesystem functions Operating System: Windows/Linux PHP Version: 7.1.26 Block user comment: N Private report: N New Comment: I'm not sure what is the bug, but for me is very ambiguous that on different platforms for the same functionality I got different results, when I use "soft" or "hard" links on both OS Linux and Windows. Previous Comments: ------------------------------------------------------------------------ [2019-02-19 19:13:30] requinix@php.net Right. And the bug is that the junction should not be resolved. Right? ------------------------------------------------------------------------ [2019-02-19 19:00:05] mesaverde228 at gmail dot com if I change mklink /J D:\test\symlinkedcachefolder D:\test\realcachefolder to mklink /d D:\test\symlinkedcachefolder D:\test\realcachefolder I got following response from CMD symbolic link created for D:\test\symlinkedcachefolder <<===>> D:\test\realcachefolder But the script "index.php" works the same as for "junction" D:\test\symlinkedcachefolder>php index.php array(4) { ["realpath(__DIR__)"]=> string(23) "D:\test\realcachefolder" ["realpath("D:\test\symlinkedcachefolder\gretta")"]=> bool(false) ["dirname(__DIR__)"]=> string(7) "D:\test" ["dirname(__DIR__ . "\gretta")"]=> string(23) "D:\test\realcachefolder" } ------------------------------------------------------------------------ [2019-02-19 18:57:00] requinix@php.net > Is that means that windows "junctions" not supported by PHP? Depends what "support" you are expecting. ------------------------------------------------------------------------ [2019-02-19 18:55:05] requinix@php.net The only bug I can see here is that realpath() on a junction is resolving it D:\test\symlinkedcachefolder>php -r "var_dump(realpath('D:/test/symlinkedcachefolder'));" string(23) "D:\test\realcachefolder" when last I knew PHP deliberately did not - only symlinks. Do you agree? ------------------------------------------------------------------------ [2019-02-19 18:53:30] mesaverde228 at gmail dot com Is that means that windows "junctions" not supported by PHP? ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=77639 -- Edit this bug report at https://bugs.php.net/bug.php?id=77639&edit=1

« previous php.bugs (#219643) next »