Closed GoogleCodeExporter closed 8 years ago
[deleted comment]
[deleted comment]
Can you provide actual path's (editing out sensitive data but still showing the
relevant paths). The path (both the one you pass and the current vQmod path) is
passed through realpath to resolve the sym links by default, therefore if it's
not working them out, then it sounds like
A) there's an issue with the symlink or
B) realpath isn't working on your system for some reason
C) The directory containing the vQmod directory isn't resolving for some reason
As you've pointed out, the path variable can be passed to the class, however
vQmod isn't intended JUST for OpenCart so this "fix" would only help for an
opencart install, and considering this is the first report of the bug, it's
likely to be your system that is causing it
Original comment by DJG6...@gmail.com
on 28 Dec 2011 at 5:54
Here they are.
On my test machine I'm using Windows 7 + HardLinkShellExt. My main store is
located at http://localhost/oc1, the second store at http://localhost/oc2. oc2
is an NTFS junction pointing to oc1 directory.
$vqmod->modCheck() resolves startup.php path in oc1 store to:
C:\ServerRoot\oc1\vqmod\vqcache\vq2-system_startup.php, whereas in oc2 store
to: C:\ServerRoot\oc1\system\startup.php.
$vqmod->_cwd is set in constructor to E:\ServerRoot\oc1 and E:\ServerRoot\oc2
for oc1 and oc2 stores respectively.
The problem lies in the following line of modCheck() method:
$stripped_filename = preg_replace('~^' . preg_quote($this->getCwd(), '~') .
'~', '', $sourcePath);
$sourcePath uses DIR_SYSTEM taken from config.php, but $vqmod->_cwd does not.
OpenCart's root path when not given explicitly is set automatically to
dirname(dirname(__FILE__)).
That's why setting vqmod path to DIR_SYSTEM . '/..' fixes the problem.
Original comment by xeml...@gmail.com
on 28 Dec 2011 at 6:24
This sounds to me like it's not understanding the symlink in realpath. Where is
HardLinkShellExt from and is it that that creates these sym links? If so, then
it's going to be down to that that it's not resolving them correctly, since
php's realpath will not be able to handle it
Original comment by DJG6...@gmail.com
on 28 Dec 2011 at 9:13
HardlinkShellExt is a nice tool that, among others, can create symlinks (or
junctions as they are called when directories are involved) under NTFS.
Yes you're right, PHP's realpath() in Windows cannot resolve NTFS symlinks.
That's a shame.
Original comment by xeml...@gmail.com
on 29 Dec 2011 at 12:17
Original comment by DJG6...@gmail.com
on 29 Dec 2011 at 3:33
Original issue reported on code.google.com by
xeml...@gmail.com
on 28 Dec 2011 at 9:56