From 068e1f3615789a107f864366db30d49466727a7a Mon Sep 17 00:00:00 2001 From: Tim Heil Date: Mon, 27 Aug 2012 13:59:34 +0200 Subject: [PATCH 1/3] Add sub-headlines to Repositories chapter --- doc/05-repositories.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/05-repositories.md b/doc/05-repositories.md index 2e2672ccd..3ec8c24f8 100644 --- a/doc/05-repositories.md +++ b/doc/05-repositories.md @@ -154,6 +154,8 @@ VCS stands for version control system. This includes versioning systems like git, svn or hg. Composer has a repository type for installing packages from these systems. +#### Maintaining a third library fork + There are a few use cases for this. The most common one is maintaining your own fork of a third party library. If you are using a certain library for your project and you decide to change something in the library, you will want your @@ -181,6 +183,8 @@ Example assuming you patched monolog to fix a bug in the `bugfix` branch: When you run `php composer.phar update`, you should get your modified version of `monolog/monolog` instead of the one from packagist. +#### Git alternatives + Git is not the only version control system supported by the VCS repository. The following are supported: From f2ba19ace2bc31166930f820c8612527f912a6c4 Mon Sep 17 00:00:00 2001 From: Tim Heil Date: Mon, 27 Aug 2012 17:46:40 +0200 Subject: [PATCH 2/3] Troubleshooting ... some lessons learnt --- doc/05-repositories.md | 2 +- doc/articles/troubleshooting.md | 40 +++++++++++++++++++++++++++++++-- 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/doc/05-repositories.md b/doc/05-repositories.md index 3ec8c24f8..35b6fc109 100644 --- a/doc/05-repositories.md +++ b/doc/05-repositories.md @@ -154,7 +154,7 @@ VCS stands for version control system. This includes versioning systems like git, svn or hg. Composer has a repository type for installing packages from these systems. -#### Maintaining a third library fork +#### Maintaining a third party library fork There are a few use cases for this. The most common one is maintaining your own fork of a third party library. If you are using a certain library for your diff --git a/doc/articles/troubleshooting.md b/doc/articles/troubleshooting.md index fd83070bf..7efc1f064 100644 --- a/doc/articles/troubleshooting.md +++ b/doc/articles/troubleshooting.md @@ -1,7 +1,42 @@ -# Memory limit errors +# Troubleshooting + +This is a list of common pitfalls on using Composer, and how to avoid them. + +## General + +1. When facing any kind of problems using Composer, be sure to **work with the + latest version**. See [self-update](03-cli.md#self-update) for details. + +2. Ensure you're **installing vendors straight from your `composer.json`** via + +~~~~ + rm -rf vendor && composer update -v +~~~~ + + when troubleshooting, excluding any possible interferences with existing + vendor installations or `composer.lock` entries. + +## Package not found + +1. Double-check you **don't have typos** in your `composer.json` or repository + branches and tag names. + +2. Be sure to **set the right + [minimum-stability](04-schema.md#minimum-stability)**. To get started or be + sure this is no issue, set `minimum-stability` to "dev". + +3. Packages **not coming from [Packagist](http://packagist.org/)** should + always be **defined in the root package** (the package depending on all + vendors). + +4. Use the **same vendor and package name** throughout all branches and tags of + your repository, especially when maintaining a third party fork and using + `replace`. + +## Memory limit errors If composer shows memory errors on some commands: @@ -16,7 +51,8 @@ Get current value: php -r "echo ini_get('memory_limit').PHP_EOL;" -Increase limit with `php.ini` for a `CLI SAPI` (ex. `/etc/php5/cli/php.ini` for Debian-like systems): +Increase limit with `php.ini` for a `CLI SAPI` (ex. `/etc/php5/cli/php.ini` for +Debian-like systems): ; Use -1 for unlimited or define explicit value like 512M memory_limit = -1 From 6c1820d006131c5415475708ebb1a93371a72bc4 Mon Sep 17 00:00:00 2001 From: Tim Heil Date: Tue, 28 Aug 2012 00:10:17 +0200 Subject: [PATCH 3/3] Add troubleshooting URL to error message --- src/Composer/DependencyResolver/SolverProblemsException.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/DependencyResolver/SolverProblemsException.php b/src/Composer/DependencyResolver/SolverProblemsException.php index 4f4a25ab5..4b6df40ed 100644 --- a/src/Composer/DependencyResolver/SolverProblemsException.php +++ b/src/Composer/DependencyResolver/SolverProblemsException.php @@ -36,7 +36,7 @@ class SolverProblemsException extends \RuntimeException } if (strpos($text, 'could not be found') || strpos($text, 'no matching package found')) { - $text .= "\nPotential causes:\n - A typo in the package name\n - The package is not available in a stable-enough version according to your minimum-stability setting\n see https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion for more details.\n"; + $text .= "\nPotential causes:\n - A typo in the package name\n - The package is not available in a stable-enough version according to your minimum-stability setting\n see for more details.\n\nRead for further common problems."; } return $text;