From 30b49860a26e3b1a9ec55fdd68918555c4946db4 Mon Sep 17 00:00:00 2001 From: Roberto Guido Date: Mon, 13 Nov 2023 19:07:56 +0100 Subject: [PATCH] Update Setup.php better check for symlink in Linux --- setup/Setup.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/setup/Setup.php b/setup/Setup.php index 021b377..c94deda 100644 --- a/setup/Setup.php +++ b/setup/Setup.php @@ -1013,12 +1013,19 @@ public static function setup(Event $event) { } catch(Exception $e) { $symlink_manual_creation_command= "WARNING! At the end of the installation execute as administrator this command:\n$mklink_cmd"; } - + } else { // linux - symlink($cmd_target, $cmd_link); + if (is_link($cmd_link)) { + if (readlink($cmd_link) != $cmd_target) { + $symlink_manual_creation_command= "WARNING! At the end of the installation check the symbolic link at $cmd_link, it must link to $cmd_target"; + } + } + else { + symlink($cmd_target, $cmd_link); + } } - + if ($symlink_manual_creation_command === false) { echo $colors->getColoredString("OK", "green"); } else {