Procházet zdrojové kódy

Merge pull request #491 from brikou/issue_with_symlinks

fixed issue when creating symlinks under linux (not always allowed ... issue #486)
Jordi Boggiano před 13 roky
rodič
revize
0ac89b2d99
1 změnil soubory, kde provedl 8 přidání a 1 odebrání
  1. 8 1
      src/Composer/Installer/LibraryInstaller.php

+ 8 - 1
src/Composer/Installer/LibraryInstaller.php

@@ -169,7 +169,14 @@ class LibraryInstaller implements InstallerInterface
                 }
                 file_put_contents($link, $this->generateWindowsProxyCode($bin, $link));
             } else {
-                symlink($bin, $link);
+                try {
+                    // under linux symlinks are not always supported for example
+                    // when using it in smbfs mounted folder
+                    symlink($bin, $link);
+                } catch (\ErrorException $e) {
+                    file_put_contents($link, $this->generateUnixyProxyCode($bin, $link));
+                }
+
             }
             chmod($link, 0755);
         }