Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[11.x] use exec function if the symlink function is unavailable #54651

Merged
merged 3 commits into from
Feb 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/Illuminate/Filesystem/Filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess, you are missing an additional space on both sides for the style check to pass:

Suggested change
}else{
} else {

return exec("ln -s ".escapeshellarg($target).' '.escapeshellarg($link)) !== false;
}
}

$mode = $this->isDirectory($target) ? 'J' : 'H';
Expand Down
Loading