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

Conversation

aisuvro
Copy link
Contributor

@aisuvro aisuvro commented Feb 17, 2025

If the symlink function is unavailable, it falls back to using the exec function to run the ln -s command, creating a symbolic link using the shell.

I have tried both GitHub actions and cpanel. By default, the symlink() function does not exist for security reasons. We usually fix it by manually using the bash command "ln -s" to fix this issue.

GitHub action image below.
image

Cpanel image below.
image

 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.
@aisuvro aisuvro changed the title Update Filesystem.php [11.x] use exec function if the symlink function is unavailable Feb 17, 2025
@taylorotwell taylorotwell merged commit 834a024 into laravel:11.x Feb 17, 2025
43 of 44 checks passed
@aisuvro
Copy link
Contributor Author

aisuvro commented Feb 17, 2025

Thank you for the merge.
@taylorotwell

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 {

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants