|
@@ -220,8 +220,15 @@ class Factory
|
|
// setup process timeout
|
|
// setup process timeout
|
|
ProcessExecutor::setTimeout((int) $config->get('process-timeout'));
|
|
ProcessExecutor::setTimeout((int) $config->get('process-timeout'));
|
|
|
|
|
|
|
|
+ // initialize composer
|
|
|
|
+ $composer = new Composer();
|
|
|
|
+ $composer->setConfig($config);
|
|
|
|
+
|
|
|
|
+ // initialize event dispatcher
|
|
|
|
+ $dispatcher = new EventDispatcher($composer, $io);
|
|
|
|
+
|
|
// initialize repository manager
|
|
// initialize repository manager
|
|
- $rm = $this->createRepositoryManager($io, $config);
|
|
|
|
|
|
+ $rm = $this->createRepositoryManager($io, $config, $dispatcher);
|
|
|
|
|
|
// load local repository
|
|
// load local repository
|
|
$this->addLocalRepository($rm, $vendorDir);
|
|
$this->addLocalRepository($rm, $vendorDir);
|
|
@@ -234,16 +241,11 @@ class Factory
|
|
// initialize installation manager
|
|
// initialize installation manager
|
|
$im = $this->createInstallationManager();
|
|
$im = $this->createInstallationManager();
|
|
|
|
|
|
- // initialize composer
|
|
|
|
- $composer = new Composer();
|
|
|
|
- $composer->setConfig($config);
|
|
|
|
|
|
+ // Composer composition
|
|
$composer->setPackage($package);
|
|
$composer->setPackage($package);
|
|
$composer->setRepositoryManager($rm);
|
|
$composer->setRepositoryManager($rm);
|
|
$composer->setInstallationManager($im);
|
|
$composer->setInstallationManager($im);
|
|
|
|
|
|
- // initialize event dispatcher
|
|
|
|
- $dispatcher = new EventDispatcher($composer, $io);
|
|
|
|
-
|
|
|
|
// initialize download manager
|
|
// initialize download manager
|
|
$dm = $this->createDownloadManager($io, $config, $dispatcher);
|
|
$dm = $this->createDownloadManager($io, $config, $dispatcher);
|
|
|
|
|
|
@@ -285,9 +287,9 @@ class Factory
|
|
* @param Config $config
|
|
* @param Config $config
|
|
* @return Repository\RepositoryManager
|
|
* @return Repository\RepositoryManager
|
|
*/
|
|
*/
|
|
- protected function createRepositoryManager(IOInterface $io, Config $config)
|
|
|
|
|
|
+ protected function createRepositoryManager(IOInterface $io, Config $config, EventDispatcher $eventDispatcher = null)
|
|
{
|
|
{
|
|
- $rm = new RepositoryManager($io, $config);
|
|
|
|
|
|
+ $rm = new RepositoryManager($io, $config, $eventDispatcher);
|
|
$rm->setRepositoryClass('composer', 'Composer\Repository\ComposerRepository');
|
|
$rm->setRepositoryClass('composer', 'Composer\Repository\ComposerRepository');
|
|
$rm->setRepositoryClass('vcs', 'Composer\Repository\VcsRepository');
|
|
$rm->setRepositoryClass('vcs', 'Composer\Repository\VcsRepository');
|
|
$rm->setRepositoryClass('package', 'Composer\Repository\PackageRepository');
|
|
$rm->setRepositoryClass('package', 'Composer\Repository\PackageRepository');
|