Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

WIP [Issue #1135] create project in existing directory #1182

Closed
wants to merge 48 commits into
from
Commits
Jump to file or symbol
Failed to load files and symbols.
+1,226 −116
Split
View
@@ -49,7 +49,7 @@ any version beginning with `1.0`.
#### Locally
To actually get Composer, we need to do two things. The first one is installing
-Composer (again, this mean downloading it into your project):
+Composer (again, this means downloading it into your project):
$ curl -s https://getcomposer.org/installer | php
View
@@ -117,7 +117,7 @@ Test it by inspecting the zip file generated manually:
git archive branchName --format zip -o file.zip
-> **Note:** files would be still tracked by git just not included in the
+> **Note:** Files would be still tracked by git just not included in the
> distribution. This will only work for GitHub packages installed from
> dist (i.e. tagged releases) for now.
View
@@ -504,8 +504,10 @@ ignored.
The following repository types are supported:
* **composer:** A composer repository is simply a `packages.json` file served
- via HTTP, that contains a list of `composer.json` objects with additional
- `dist` and/or `source` information.
+ via the network (HTTP, FTP, SSH), that contains a list of `composer.json`
+ objects with additional `dist` and/or `source` information. The `packages.json`
+ file is loaded using a PHP stream. You can set extra options on that stream
+ using the `options` parameter.
* **vcs:** The version control system repository can fetch packages from git,
svn and hg repositories.
* **pear:** With this you can import any pear repository into your composer
@@ -525,6 +527,15 @@ Example:
"url": "http://packages.example.com"
},
{
+ "type": "composer",
+ "url": "https://packages.example.com",
+ "options": {
+ "ssl": {
+ "verify_peer": "true"
+ }
+ }
+ },
+ {
"type": "vcs",
"url": "https://github.com/Seldaek/monolog"
},
View
@@ -148,12 +148,21 @@ hash changed.
This field is optional. You probably don't need it for your own custom
repository.
+#### stream options
+
+The `packages.json` file is loaded using a PHP stream. You can set extra options
+on that stream using the `options` parameter. You can set any valid PHP stream
+context option. See [Context options and parameters](http://nl3.php.net/manual/en/context.php)
+for more information.
+
### VCS
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 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
project and you decide to change something in the library, you will want your
@@ -181,6 +190,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:
@@ -85,3 +85,43 @@ itself.
"company/package3": "dev-master"
}
}
+
+### Security
+
+To secure your private repository you can host it over SSH or SSL using a client
+certificate. In your project you can use the `options` parameter to specify the
+connection options for the server.
+
+Example using a custom repository using SSH (requires the SSH2 PECL extension):
+
+ {
+ "repositories": [
+ {
+ "type": "composer",
+ "url": "ssh2.sftp://example.org",
+ "options": {
+ "ssh2": {
+ "username": "composer",
+ "pubkey_file": "/home/composer/.ssh/id_rsa.pub",
+ "privkey_file": "/home/composer/.ssh/id_rsa"
+ }
+ }
+ }
+ ]
+ }
+
+Example using HTTP over SSL using a client certificate:
+
+ {
+ "repositories": [
+ {
+ "type": "composer",
+ "url": "https://example.org",
+ "options": {
+ "ssl": {
+ "cert_file": "/home/composer/.ssl/composer.pem",
+ }
+ }
+ }
+ ]
+ }
@@ -1,7 +1,38 @@
<!--
tagline: Solving problems
-->
-# 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 +47,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
Oops, something went wrong.