Browse Source

Fix ComposerRepository calls, fixes #475

Jordi Boggiano 13 years ago
parent
commit
ea2d46bcff

+ 2 - 2
src/Composer/Command/CreateProjectCommand.php

@@ -85,11 +85,11 @@ EOT
         }
 
         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.");
         }

+ 1 - 1
src/Composer/Command/InitCommand.php

@@ -229,7 +229,7 @@ EOT
         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())
             ));
         }
 

+ 2 - 1
src/Composer/Command/SearchCommand.php

@@ -54,7 +54,8 @@ EOT
         } 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');

+ 2 - 1
src/Composer/Command/ShowCommand.php

@@ -65,7 +65,8 @@ EOT
         } 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