Fix ComposerRepository calls, fixes #475

main
Jordi Boggiano 12 years ago
parent 45b2165057
commit ea2d46bcff

@ -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.");
} }

@ -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())
)); ));
} }

@ -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');

@ -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

Loading…
Cancel
Save