diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 6c3be2943..ec1e3bc22 100644 --- a/.github/CONTRIBUTING.md +++ b/.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 diff --git a/README.md b/README.md index 1d011132f..23ae7a172 100644 --- a/README.md +++ b/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 - - -
-Jordi Boggiano - - -
+- Nils Adermann | [GitHub](https://github.com/naderman) | [Twitter](https://twitter.com/naderman) | | [naderman.de](http://naderman.de) +- Jordi Boggiano | [GitHub](https://github.com/Seldaek) | [Twitter](https://twitter.com/seldaek) | | [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 --------------- diff --git a/doc/03-cli.md b/doc/03-cli.md index 2a6be0911..5beb2fe6e 100644 --- a/doc/03-cli.md +++ b/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. diff --git a/src/Composer/Autoload/ClassLoader.php b/src/Composer/Autoload/ClassLoader.php index ff6ecfb82..ac67d302a 100644 --- a/src/Composer/Autoload/ClassLoader.php +++ b/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; } } diff --git a/src/Composer/Console/Application.php b/src/Composer/Console/Application.php index 430f7816c..252ee16b7 100644 --- a/src/Composer/Console/Application.php +++ b/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('The following exception is caused by a lack of memory and not having swap configured', true, IOInterface::QUIET); + $io->writeError('The following exception is caused by a lack of memory or swap, or not having swap configured', true, IOInterface::QUIET); $io->writeError('Check https://getcomposer.org/doc/articles/troubleshooting.md#proc-open-fork-failed-errors for details', true, IOInterface::QUIET); } } diff --git a/src/Composer/Util/Git.php b/src/Composer/Util/Git.php index 596188fe6..8edbbec37 100644 --- a/src/Composer/Util/Git.php +++ b/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; diff --git a/tests/Composer/Test/AllFunctionalTest.php b/tests/Composer/Test/AllFunctionalTest.php index 7ef3aa0af..c1751fa3d 100644 --- a/tests/Composer/Test/AllFunctionalTest.php +++ b/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':