test before chdir
parent
e712130062
commit
b4cb2f7321
|
@ -597,16 +597,15 @@ class Filesystem
|
||||||
*/
|
*/
|
||||||
public function relativeSymlink($target, $link)
|
public function relativeSymlink($target, $link)
|
||||||
{
|
{
|
||||||
|
if (!function_exists('symlink')) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$cwd = getcwd();
|
$cwd = getcwd();
|
||||||
|
|
||||||
$relativePath = $this->findShortestPath($link, $target);
|
$relativePath = $this->findShortestPath($link, $target);
|
||||||
chdir(\dirname($link));
|
chdir(\dirname($link));
|
||||||
|
$result = @symlink($relativePath, $link);
|
||||||
if (function_exists('symlink')) {
|
|
||||||
$result = @symlink($relativePath, $link);
|
|
||||||
} else {
|
|
||||||
$result = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
chdir($cwd);
|
chdir($cwd);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue