From 3068e92446d4c6f97d295ba9e4abbbb4bd3c0ca6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Pineau?= Date: Wed, 13 Jun 2012 18:30:51 +0200 Subject: [PATCH] [Doc] Added a note to install composer globally --- doc/00-intro.md | 11 +++++++++++ doc/03-cli.md | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/doc/00-intro.md b/doc/00-intro.md index b4fd4699e..d0a71fcf0 100644 --- a/doc/00-intro.md +++ b/doc/00-intro.md @@ -46,6 +46,8 @@ any version beginning with `1.0`. ### Downloading the Composer Executable +#### 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): @@ -61,10 +63,19 @@ option and providing a target directory (it can be an absolute or relative path) $ curl -s http://getcomposer.org/installer | php -- --install-dir=bin +#### Globally + You can place this file anywhere you wish. If you put it in your `PATH`, you can access it globally. On unixy systems you can even make it executable and invoke it without `php`. +You can run these commands to easily acces `composer` from anywhere on your system: + + $ curl -s http://getcomposer.org/installer | php + $ sudo mv composer.phar /usr/local/bin/composer + +Then, just run `composer` in order to run composer + ### Using Composer Next, run the `install` command to resolve and download dependencies: diff --git a/doc/03-cli.md b/doc/03-cli.md index 2a175f815..1070bcc99 100644 --- a/doc/03-cli.md +++ b/doc/03-cli.md @@ -177,6 +177,11 @@ command. It will replace your `composer.phar` with the latest version. $ php composer.phar self-update +If you have installed composer for your entire system (see [global installation](00-intro.md#globally)), +you have to run the command with `root` privileges + + $ sudo composer self-update + ## create-project You can use Composer to create new projects from an existing package.