Exemplo n.º 1
0
 /**
  * @param array $localConfig
  * @return \Composer\Composer
  */
 public function createComposer(array $localConfig)
 {
     $io = new \Composer\IO\NullIO();
     $composer = new \Composer\Composer();
     $composerConfig = new \Composer\Config();
     $composerConfig->merge(array('config' => array('home' => CM_Bootloader::getInstance()->getDirTmp() . 'composer/')));
     $composerConfig->merge($localConfig);
     $composer->setConfig($composerConfig);
     $im = $this->createInstallationManager();
     $composer->setInstallationManager($im);
     $this->createDefaultInstallers($im, $composer, $io);
     $dispatcher = new \Composer\EventDispatcher\EventDispatcher($composer, $io);
     $composer->setEventDispatcher($dispatcher);
     $generator = new \Composer\Autoload\AutoloadGenerator($dispatcher);
     $composer->setAutoloadGenerator($generator);
     $rm = $this->createRepositoryManager($composer, $io);
     $composer->setRepositoryManager($rm);
     $loader = new \Composer\Package\Loader\RootPackageLoader($rm, $composerConfig);
     $package = $loader->load($localConfig);
     $composer->setPackage($package);
     return $composer;
 }
Exemplo n.º 2
0
 /**
  * Creates a composer instance for testing.
  *
  * @return \Composer\Composer
  */
 protected function createComposer()
 {
     $config = new \Composer\Config();
     $config->merge(array('config' => array('vendor-dir' => dirname(__FILE__) . '/_files/vendor', 'bin-dir' => dirname(__FILE__) . '/_files/bin')));
     $composer = new \Composer\Composer();
     $composer->setConfig($config);
     $composer->setPackage($this->createRootPackage());
     return $composer;
 }
Exemplo n.º 3
0
 private function getComposerConfig()
 {
     $config = new \Composer\Config();
     $config->merge(array('config' => array('vendor-dir', __DIR__ . DIRECTORY_SEPARATOR . 'Fixtures/vendor')));
     return $config;
 }