From 384ed2822d714618469a222e15f51161886aae5a Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 26 Dec 2013 16:35:20 +0100 Subject: [PATCH] Fire pre-update|install-cmd event as early as it should be, refs #2520 --- src/Composer/Installer.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Composer/Installer.php b/src/Composer/Installer.php index 0970b75f4..af1540cef 100644 --- a/src/Composer/Installer.php +++ b/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);