Ver Fonte

Clarify that composer.json is being read and not downloaded, refs #2096

Jordi Boggiano há 12 anos atrás
pai
commit
e99b327342
2 ficheiros alterados com 3 adições e 3 exclusões
  1. 2 2
      src/Composer/Factory.php
  2. 1 1
      src/Composer/Util/RemoteFilesystem.php

+ 2 - 2
src/Composer/Factory.php

@@ -126,7 +126,7 @@ class Factory
 
     public static function getComposerFile()
     {
-        return trim(getenv('COMPOSER')) ?: 'composer.json';
+        return trim(getenv('COMPOSER')) ?: './composer.json';
     }
 
     public static function createAdditionalStyles()
@@ -191,7 +191,7 @@ class Factory
             $file = new JsonFile($localConfig, new RemoteFilesystem($io));
 
             if (!$file->exists()) {
-                if ($localConfig === 'composer.json') {
+                if ($localConfig === './composer.json' || $localConfig === 'composer.json') {
                     $message = 'Composer could not find a composer.json file in '.getcwd();
                 } else {
                     $message = 'Composer could not find the config file: '.$localConfig;

+ 1 - 1
src/Composer/Util/RemoteFilesystem.php

@@ -107,7 +107,7 @@ class RemoteFilesystem
         $options = $this->getOptionsForUrl($originUrl, $additionalOptions);
 
         if ($this->io->isDebug()) {
-            $this->io->write('Downloading '.$fileUrl);
+            $this->io->write((substr($fileUrl, 0, 4) === 'http' ? 'Downloading ' : 'Reading ') . $fileUrl);
         }
         if (isset($options['github-token'])) {
             $fileUrl .= (false === strpos($fileUrl, '?') ? '?' : '&') . 'access_token='.$options['github-token'];