From 60f96d5135d4eac2201e6750bd5551c49170e7dd Mon Sep 17 00:00:00 2001 From: Tobias Munk Date: Sun, 2 Jun 2013 23:21:36 +0200 Subject: [PATCH] fixed post-create-project-cmd event event occurs after autoloader is generated and refreshed --- src/Composer/Command/CreateProjectCommand.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Composer/Command/CreateProjectCommand.php b/src/Composer/Command/CreateProjectCommand.php index af9b3f581..228df2c11 100644 --- a/src/Composer/Command/CreateProjectCommand.php +++ b/src/Composer/Command/CreateProjectCommand.php @@ -164,11 +164,6 @@ EOT return 1; } - if ($noScripts === false) { - // dispatch event - $this->getComposer()->getEventDispatcher()->dispatchCommandEvent(ScriptEvents::POST_CREATE_PROJECT_CMD, $installDevPackages); - } - $hasVcs = $installedFromVcs; if (!$keepVcs && $installedFromVcs && ( @@ -211,6 +206,12 @@ EOT } } + if ($noScripts === false) { + // dispatch event + require($this->getComposer()->getConfig()->get('vendor-dir').'/autoload.php'); + $this->getComposer()->getEventDispatcher()->dispatchCommandEvent(ScriptEvents::POST_CREATE_PROJECT_CMD, $installDevPackages); + } + return 0; }