From 6aa58fabf4a1a28d9a85b9e9be8e599bc1193802 Mon Sep 17 00:00:00 2001 From: "Md. Al Imran Suvro" <2842856+aisuvro@users.noreply.github.com> Date: Mon, 17 Feb 2025 16:57:38 +0600 Subject: [PATCH 1/3] Update Filesystem.php If the `symlink` function is not available, it falls back to using the `exec` function to run the `ln -s` command, which creates a symbolic link using the shell. --- src/Illuminate/Filesystem/Filesystem.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Illuminate/Filesystem/Filesystem.php b/src/Illuminate/Filesystem/Filesystem.php index 67e31c0bf4f9..685010085d27 100644 --- a/src/Illuminate/Filesystem/Filesystem.php +++ b/src/Illuminate/Filesystem/Filesystem.php @@ -352,7 +352,11 @@ public function copy($path, $target) public function link($target, $link) { if (! windows_os()) { - return symlink($target, $link); + if(function_exists('symlink')) { + return symlink($target, $link); + }else{ + return exec("ln -s ".escapeshellarg($target).' '.escapeshellarg($link)); + } } $mode = $this->isDirectory($target) ? 'J' : 'H'; From 1fa3ec044718099fa49e5af6f46e39560d761be9 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Mon, 17 Feb 2025 09:42:50 -0600 Subject: [PATCH 2/3] Update Filesystem.php --- src/Illuminate/Filesystem/Filesystem.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Filesystem/Filesystem.php b/src/Illuminate/Filesystem/Filesystem.php index 685010085d27..7a76919ecec7 100644 --- a/src/Illuminate/Filesystem/Filesystem.php +++ b/src/Illuminate/Filesystem/Filesystem.php @@ -352,7 +352,7 @@ public function copy($path, $target) public function link($target, $link) { if (! windows_os()) { - if(function_exists('symlink')) { + if (function_exists('symlink')) { return symlink($target, $link); }else{ return exec("ln -s ".escapeshellarg($target).' '.escapeshellarg($link)); From 986c1fe973a5acaab96c76d1c75feda7253c34f4 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Mon, 17 Feb 2025 09:43:27 -0600 Subject: [PATCH 3/3] Update Filesystem.php --- src/Illuminate/Filesystem/Filesystem.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Filesystem/Filesystem.php b/src/Illuminate/Filesystem/Filesystem.php index 7a76919ecec7..061f218ef715 100644 --- a/src/Illuminate/Filesystem/Filesystem.php +++ b/src/Illuminate/Filesystem/Filesystem.php @@ -355,7 +355,7 @@ public function link($target, $link) if (function_exists('symlink')) { return symlink($target, $link); }else{ - return exec("ln -s ".escapeshellarg($target).' '.escapeshellarg($link)); + return exec("ln -s ".escapeshellarg($target).' '.escapeshellarg($link)) !== false; } }