Forráskód Böngészése

Merge branch 'master' of github.com:fvdb/composer into add-minor-only-option

Frank van den Brink 8 éve
szülő
commit
79d1a050e3

+ 1 - 1
.github/CONTRIBUTING.md

@@ -2,7 +2,7 @@ Contributing to Composer
 ========================
 
 Please note that this project is released with a
-[Contributor Code of Conduct](http://contributor-covenant.org/version/1/2/0/).
+[Contributor Code of Conduct](http://contributor-covenant.org/version/1/4/).
 By participating in this project you agree to abide by its terms.
 
 Reporting Issues

+ 9 - 30
README.md

@@ -1,7 +1,7 @@
 Composer - Dependency Management for PHP
 ========================================
 
-Composer helps you declare, manage and install dependencies of PHP projects, ensuring you have the right stack everywhere.
+Composer helps you declare, manage and install dependencies of PHP projects.
 
 See [https://getcomposer.org/](https://getcomposer.org/) for more information and documentation.
 
@@ -12,33 +12,12 @@ See [https://getcomposer.org/](https://getcomposer.org/) for more information an
 Installation / Usage
 --------------------
 
-1. Download and install Composer by following the [official instructions](https://getcomposer.org/download/).
-2. Create a composer.json defining your dependencies. Note that this example is
-a short version for applications that are not meant to be published as packages
-themselves. To create libraries/packages please read the
-[documentation](https://getcomposer.org/doc/02-libraries.md).
+Download and install Composer by following the [official instructions](https://getcomposer.org/download/).
 
-    ``` json
-    {
-        "require": {
-            "monolog/monolog": ">=1.0.0"
-        }
-    }
-    ```
+Packages
+--------
 
-3. Run Composer: `php composer.phar install`
-4. Browse for more packages on [Packagist](https://packagist.org).
-
-Global installation of Composer (manual)
-----------------------------------------
-
-Follow instructions [in the documentation](https://getcomposer.org/doc/00-intro.md#globally)
-
-Updating Composer
------------------
-
-Running `php composer.phar self-update` or equivalent will update a phar
-install to the latest version.
+Find packages on [Packagist](https://packagist.org).
 
 Community
 ---------
@@ -50,7 +29,7 @@ For support, Stack Overflow also offers a good collection of
 [Composer related questions](https://stackoverflow.com/questions/tagged/composer-php).
 
 Please note that this project is released with a
-[Contributor Code of Conduct](http://contributor-covenant.org/version/1/2/0/).
+[Contributor Code of Conduct](http://contributor-covenant.org/version/1/4/).
 By participating in this project and its community you agree to abide by those terms.
 
 Requirements
@@ -61,15 +40,15 @@ PHP 5.3.2 or above (at least 5.3.4 recommended to avoid potential bugs)
 Authors
 -------
 
-Nils Adermann - <naderman@naderman.de> - <https://twitter.com/naderman> - <http://www.naderman.de><br />
-Jordi Boggiano - <j.boggiano@seld.be> - <https://twitter.com/seldaek> - <http://seld.be><br />
+- Nils Adermann  | [GitHub](https://github.com/naderman)  | [Twitter](https://twitter.com/naderman) | <naderman@naderman.de> | [naderman.de](http://naderman.de)
+- Jordi Boggiano | [GitHub](https://github.com/Seldaek) | [Twitter](https://twitter.com/seldaek) | <j.boggiano@seld.be> | [seld.be](http://seld.be)
 
 See also the list of [contributors](https://github.com/composer/composer/contributors) who participated in this project.
 
 License
 -------
 
-Composer is licensed under the MIT License - see the LICENSE file for details
+Composer is licensed under the MIT License - see the [LICENSE](LICENSE) file for details
 
 Acknowledgments
 ---------------

+ 2 - 0
doc/03-cli.md

@@ -99,6 +99,7 @@ resolution.
 * **--no-scripts:** Skips execution of scripts defined in `composer.json`.
 * **--no-progress:** Removes the progress display that can mess with some
   terminals or scripts which don't handle backspace characters.
+* **--no-suggest:** Skips suggested packages in the output.
 * **--optimize-autoloader (-o):** Convert PSR-0/4 autoloading to classmap to get a faster
   autoloader. This is recommended especially for production, but can take
   a bit of time to run so it is currently not done by default.
@@ -143,6 +144,7 @@ php composer.phar update vendor/*
 * **--no-scripts:** Skips execution of scripts defined in `composer.json`.
 * **--no-progress:** Removes the progress display that can mess with some
   terminals or scripts which don't handle backspace characters.
+* **--no-suggest:** Skips suggested packages in the output.
 * **--optimize-autoloader (-o):** Convert PSR-0/4 autoloading to classmap to get a faster
   autoloader. This is recommended especially for production, but can take
   a bit of time to run so it is currently not done by default.

+ 7 - 5
src/Composer/Autoload/ClassLoader.php

@@ -53,8 +53,8 @@ class ClassLoader
 
     private $useIncludePath = false;
     private $classMap = array();
-
     private $classMapAuthoritative = false;
+    private $missingClasses = array();
 
     public function getPrefixes()
     {
@@ -322,20 +322,20 @@ class ClassLoader
         if (isset($this->classMap[$class])) {
             return $this->classMap[$class];
         }
-        if ($this->classMapAuthoritative) {
+        if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
             return false;
         }
 
         $file = $this->findFileWithExtension($class, '.php');
 
         // Search for Hack files if we are running on HHVM
-        if ($file === null && defined('HHVM_VERSION')) {
+        if (false === $file && defined('HHVM_VERSION')) {
             $file = $this->findFileWithExtension($class, '.hh');
         }
 
-        if ($file === null) {
+        if (false === $file) {
             // Remember that this class does not exist.
-            return $this->classMap[$class] = false;
+            $this->missingClasses[$class] = true;
         }
 
         return $file;
@@ -399,6 +399,8 @@ class ClassLoader
         if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
             return $file;
         }
+
+        return false;
     }
 }
 

+ 1 - 1
src/Composer/Console/Application.php

@@ -296,7 +296,7 @@ class Application extends BaseApplication
         }
 
         if (false !== strpos($exception->getMessage(), 'fork failed - Cannot allocate memory')) {
-            $io->writeError('<error>The following exception is caused by a lack of memory and not having swap configured</error>', true, IOInterface::QUIET);
+            $io->writeError('<error>The following exception is caused by a lack of memory or swap, or not having swap configured</error>', true, IOInterface::QUIET);
             $io->writeError('<error>Check https://getcomposer.org/doc/articles/troubleshooting.md#proc-open-fork-failed-errors for details</error>', true, IOInterface::QUIET);
         }
     }

+ 6 - 1
src/Composer/Util/Git.php

@@ -234,7 +234,12 @@ class Git
             return false;
         }
 
-        $authFailures = array('fatal: Authentication failed', 'remote error: Invalid username or password.');
+        $authFailures = array(
+            'fatal: Authentication failed',
+            'remote error: Invalid username or password.',
+            'error: 401 Unauthorized'
+        );
+
         foreach ($authFailures as $authFailure) {
             if (strpos($this->process->getErrorOutput(), $authFailure) !== false) {
                 return true;

+ 1 - 0
tests/Composer/Test/AllFunctionalTest.php

@@ -183,6 +183,7 @@ class AllFunctionalTest extends TestCase
 
                 case 'EXPECT-EXIT-CODE':
                     $sectionData = (integer) $sectionData;
+                    break;
 
                 case 'EXPECT':
                 case 'EXPECT-REGEX':