Skip to content

Commit

Permalink
Fix ComposerRepository calls, fixes composer#475
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Mar 20, 2012
1 parent 45b2165 commit ea2d46b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/Composer/Command/CreateProjectCommand.php
Expand Up @@ -85,11 +85,11 @@ public function installProject(IOInterface $io, $packageName, $directory = null,
}

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)) {
$sourceRepo = new FilesystemRepository(new JsonFile($repositoryUrl, new RemoteFilesystem($io)));
} elseif (0 === strpos($repositoryUrl, 'http')) {
$sourceRepo = new ComposerRepository(array('url' => $repositoryUrl));
$sourceRepo = new ComposerRepository(array('url' => $repositoryUrl), $this->getIO());
} else {
throw new \InvalidArgumentException("Invalid repository url given. Has to be a .json file or an http url.");
}
Expand Down
2 changes: 1 addition & 1 deletion src/Composer/Command/InitCommand.php
Expand Up @@ -229,7 +229,7 @@ protected function findPackages($name)
if (!$this->repos) {
$this->repos = new CompositeRepository(array(
new PlatformRepository,
new ComposerRepository(array('url' => 'http://packagist.org'))
new ComposerRepository(array('url' => 'http://packagist.org'), $this->getIO())
));
}

Expand Down
3 changes: 2 additions & 1 deletion src/Composer/Command/SearchCommand.php
Expand Up @@ -54,7 +54,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
} else {
$output->writeln('No composer.json found in the current directory, showing packages from packagist.org');
$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');
Expand Down
3 changes: 2 additions & 1 deletion src/Composer/Command/ShowCommand.php
Expand Up @@ -65,7 +65,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
} else {
$output->writeln('No composer.json found in the current directory, showing packages from packagist.org');
$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
Expand Down

0 comments on commit ea2d46b

Please sign in to comment.