Procházet zdrojové kódy

Force a redownload to source when updating from dist to dev package

Jordi Boggiano před 13 roky
rodič
revize
983de81b1d
1 změnil soubory, kde provedl 7 přidání a 0 odebrání
  1. 7 0
      src/Composer/Downloader/DownloadManager.php

+ 7 - 0
src/Composer/Downloader/DownloadManager.php

@@ -164,6 +164,13 @@ class DownloadManager
             $targetType  = $target->getSourceType();
         }
 
+        // upgrading from a dist stable package to a dev package, force source reinstall
+        if ($target->isDev() && 'dist' === $installationSource) {
+            $downloader->remove($initial, $targetDir);
+            $this->download($target, $targetDir, 'source' === $installationSource);
+            return;
+        }
+
         if ($initialType === $targetType) {
             $target->setInstallationSource($installationSource);
             $downloader->update($initial, $target, $targetDir);