From d4fb403fd711b47ecd98f1a240b5baf1ffa7ddf5 Mon Sep 17 00:00:00 2001 From: qcho Date: Tue, 9 Apr 2013 03:27:37 -0300 Subject: [PATCH] Fix case where PHP's symlink returns false without any error or warning. --- src/Composer/Installer/LibraryInstaller.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Composer/Installer/LibraryInstaller.php b/src/Composer/Installer/LibraryInstaller.php index 009239af6..b4938f848 100644 --- a/src/Composer/Installer/LibraryInstaller.php +++ b/src/Composer/Installer/LibraryInstaller.php @@ -217,7 +217,9 @@ class LibraryInstaller implements InstallerInterface // when using it in smbfs mounted folder $relativeBin = $this->filesystem->findShortestPath($link, $binPath); chdir(dirname($link)); - symlink($relativeBin, $link); + if (false === symlink($relativeBin, $link)) { + throw new \ErrorException(); + } } catch (\ErrorException $e) { file_put_contents($link, $this->generateUnixyProxyCode($binPath, $link)); }