浏览代码

Fire pre-update|install-cmd event as early as it should be, refs #2520

Jordi Boggiano 11 年之前
父节点
当前提交
384ed2822d
共有 1 个文件被更改,包括 6 次插入6 次删除
  1. 6 6
      src/Composer/Installer.php

+ 6 - 6
src/Composer/Installer.php

@@ -173,6 +173,12 @@ class Installer
         unset($devRepo, $package);
         // end BC
 
+        if ($this->runScripts) {
+            // dispatch pre event
+            $eventName = $this->update ? ScriptEvents::PRE_UPDATE_CMD : ScriptEvents::PRE_INSTALL_CMD;
+            $this->eventDispatcher->dispatchCommandEvent($eventName, $this->devMode);
+        }
+
         $this->downloadManager->setPreferSource($this->preferSource);
         $this->downloadManager->setPreferDist($this->preferDist);
 
@@ -199,12 +205,6 @@ class Installer
         $aliases = $this->getRootAliases();
         $this->aliasPlatformPackages($platformRepo, $aliases);
 
-        if ($this->runScripts) {
-            // dispatch pre event
-            $eventName = $this->update ? ScriptEvents::PRE_UPDATE_CMD : ScriptEvents::PRE_INSTALL_CMD;
-            $this->eventDispatcher->dispatchCommandEvent($eventName, $this->devMode);
-        }
-
         try {
             $this->suggestedPackages = array();
             $res = $this->doInstall($localRepo, $installedRepo, $platformRepo, $aliases, $this->devMode);