updated events to use composer from Factory

PSR-0 autoloading is now handled correctly
main
Tobias Munk 11 years ago
parent 27b3f338e9
commit c1cae8d838

@ -143,14 +143,15 @@ EOT
$installedFromVcs = false; $installedFromVcs = false;
} }
$composer = Factory::create($io);
if ($noScripts === false) { if ($noScripts === false) {
// dispatch event // dispatch event
$this->getComposer()->getEventDispatcher()->dispatchCommandEvent(ScriptEvents::POST_ROOT_PACKAGE_INSTALL, $installDevPackages); $composer->getEventDispatcher()->dispatchCommandEvent(ScriptEvents::POST_ROOT_PACKAGE_INSTALL, $installDevPackages);
} }
// install dependencies of the created project // install dependencies of the created project
$composer = Factory::create($io);
$installer = Installer::create($io, $composer); $installer = Installer::create($io, $composer);
$installer->setPreferSource($preferSource) $installer->setPreferSource($preferSource)
->setPreferDist($preferDist) ->setPreferDist($preferDist)
->setDevMode($installDevPackages) ->setDevMode($installDevPackages)
@ -207,10 +208,8 @@ EOT
} }
if ($noScripts === false) { if ($noScripts === false) {
// TODO: improve autoloader refreshing
require($this->getComposer()->getConfig()->get('vendor-dir').'/autoload.php');
// dispatch event // dispatch event
$this->getComposer()->getEventDispatcher()->dispatchCommandEvent(ScriptEvents::POST_CREATE_PROJECT_CMD, $installDevPackages); $composer->getEventDispatcher()->dispatchCommandEvent(ScriptEvents::POST_CREATE_PROJECT_CMD, $installDevPackages);
} }
return 0; return 0;

Loading…
Cancel
Save