diff --git a/src/Composer/Installer.php b/src/Composer/Installer.php index 576133164..f86cfcf93 100644 --- a/src/Composer/Installer.php +++ b/src/Composer/Installer.php @@ -301,12 +301,6 @@ class Installer $this->autoloadGenerator->dump($this->config, $localRepo, $this->package, $this->installationManager, 'composer', $this->optimizeAutoloader); } - if ($this->runScripts) { - // dispatch post event - $eventName = $this->update ? ScriptEvents::POST_UPDATE_CMD : ScriptEvents::POST_INSTALL_CMD; - $this->eventDispatcher->dispatchScript($eventName, $this->devMode); - } - if ($this->executeOperations) { // force binaries re-generation in case they are missing foreach ($localRepo->getPackages() as $package) { @@ -321,6 +315,12 @@ class Installer } } + if ($this->runScripts) { + // dispatch post event + $eventName = $this->update ? ScriptEvents::POST_UPDATE_CMD : ScriptEvents::POST_INSTALL_CMD; + $this->eventDispatcher->dispatchScript($eventName, $this->devMode); + } + // re-enable GC except on HHVM which triggers a warning here if (!defined('HHVM_VERSION')) { gc_enable();