How to build composer from a source code?

Viewed 1057

I have cloned repository from GitHub. So I am wondering how to build my own composer instance from the source files?

1 Answers

It also took me a while to find it, but the installation from source instructions are listed here in the Composer repository.

Basically you can install Composer from source with Composer, e.g. composer install. Very meta! Then you can use the Composer you've installed from source with path-where-you-cloned-composer/bin/composer. See the full instructions copied below:

  1. Run git clone https://github.com/composer/composer.git
  2. Download the composer.phar executable
  3. Run Composer to get the dependencies: cd composer && php ../composer.phar install

You can run the test suite by executing vendor/bin/phpunit when inside the composer directory, and run Composer by executing the bin/composer. To test your modified Composer code against another project, run php /path/to/composer/bin/composer inside that project's directory.

(If you already have Composer installed globally, you don't need to do step 2.)

Related