1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-11 09:32:55 +00:00

Fix creation of ComposerRepository, refs #587

This commit is contained in:
Jordi Boggiano 2012-04-17 10:51:44 +02:00
parent 24ca3e440e
commit 7837be0621
5 changed files with 11 additions and 7 deletions

View file

@ -82,12 +82,13 @@ EOT
$dm->setPreferSource(true);
}
$config = Factory::createConfig();
if (null === $repositoryUrl) {
$sourceRepo = new ComposerRepository(array('url' => 'http://packagist.org'), $io);
$sourceRepo = new ComposerRepository(array('url' => 'http://packagist.org'), $io, $config);
} elseif ("json" === pathinfo($repositoryUrl, PATHINFO_EXTENSION)) {
$sourceRepo = new FilesystemRepository(new JsonFile($repositoryUrl, new RemoteFilesystem($io)));
} elseif (0 === strpos($repositoryUrl, 'http')) {
$sourceRepo = new ComposerRepository(array('url' => $repositoryUrl), $io);
$sourceRepo = new ComposerRepository(array('url' => $repositoryUrl), $io, $config);
} else {
throw new \InvalidArgumentException("Invalid repository url given. Has to be a .json file or an http url.");
}
@ -112,7 +113,7 @@ EOT
$io->write('<info>Installing ' . $package->getName() . ' as new project.</info>', true);
$projectInstaller = new ProjectInstaller($directory, $dm);
$projectInstaller->install($package);
$projectInstaller->install(new FilesystemRepository(new JsonFile('php://memory')), $package);
$io->write('<info>Created project into directory ' . $directory . '</info>', true);
chdir($directory);