Browse Source

Fix case where PHP's symlink returns false without any error or warning.

qcho 12 years ago
parent
commit
d4fb403fd7
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/Composer/Installer/LibraryInstaller.php

+ 3 - 1
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));
                 }