Explorar el Código

fixed post-create-project-cmd event
event occurs after autoloader is generated and refreshed

Tobias Munk hace 12 años
padre
commit
60f96d5135
Se han modificado 1 ficheros con 6 adiciones y 5 borrados
  1. 6 5
      src/Composer/Command/CreateProjectCommand.php

+ 6 - 5
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;
     }