1
0
Fork 0

Fix ComposerRepository calls, fixes #475

pull/483/head
Jordi Boggiano 2012-03-20 17:42:37 +01:00
parent 45b2165057
commit ea2d46bcff
4 changed files with 7 additions and 5 deletions

View File

@ -85,11 +85,11 @@ EOT
} }
if (null === $repositoryUrl) { if (null === $repositoryUrl) {
$sourceRepo = new ComposerRepository(array('url' => 'http://packagist.org')); $sourceRepo = new ComposerRepository(array('url' => 'http://packagist.org'), $this->getIO());
} elseif (".json" === substr($repositoryUrl, -5)) { } elseif (".json" === substr($repositoryUrl, -5)) {
$sourceRepo = new FilesystemRepository(new JsonFile($repositoryUrl, new RemoteFilesystem($io))); $sourceRepo = new FilesystemRepository(new JsonFile($repositoryUrl, new RemoteFilesystem($io)));
} elseif (0 === strpos($repositoryUrl, 'http')) { } elseif (0 === strpos($repositoryUrl, 'http')) {
$sourceRepo = new ComposerRepository(array('url' => $repositoryUrl)); $sourceRepo = new ComposerRepository(array('url' => $repositoryUrl), $this->getIO());
} else { } else {
throw new \InvalidArgumentException("Invalid repository url given. Has to be a .json file or an http url."); throw new \InvalidArgumentException("Invalid repository url given. Has to be a .json file or an http url.");
} }

View File

@ -229,7 +229,7 @@ EOT
if (!$this->repos) { if (!$this->repos) {
$this->repos = new CompositeRepository(array( $this->repos = new CompositeRepository(array(
new PlatformRepository, new PlatformRepository,
new ComposerRepository(array('url' => 'http://packagist.org')) new ComposerRepository(array('url' => 'http://packagist.org'), $this->getIO())
)); ));
} }

View File

@ -54,7 +54,8 @@ EOT
} else { } else {
$output->writeln('No composer.json found in the current directory, showing packages from packagist.org'); $output->writeln('No composer.json found in the current directory, showing packages from packagist.org');
$installedRepo = $platformRepo; $installedRepo = $platformRepo;
$repos = new CompositeRepository(array($installedRepo, new ComposerRepository(array('url' => 'http://packagist.org')))); $packagist = new ComposerRepository(array('url' => 'http://packagist.org'), $this->getIO());
$repos = new CompositeRepository(array($installedRepo, $packagist));
} }
$tokens = $input->getArgument('tokens'); $tokens = $input->getArgument('tokens');

View File

@ -65,7 +65,8 @@ EOT
} else { } else {
$output->writeln('No composer.json found in the current directory, showing packages from packagist.org'); $output->writeln('No composer.json found in the current directory, showing packages from packagist.org');
$installedRepo = $platformRepo; $installedRepo = $platformRepo;
$repos = new CompositeRepository(array($installedRepo, new ComposerRepository(array('url' => 'http://packagist.org')))); $packagist = new ComposerRepository(array('url' => 'http://packagist.org'), $this->getIO());
$repos = new CompositeRepository(array($installedRepo, $packagist));
} }
// show single package or single version // show single package or single version