Managing Dependencies Composer

1

Well, I started using the dependency manager for PHP Composer. I've already downloaded it and it's working. But I added a dependency on the file composer.json , and I need to do an update. How can I do this via command line?

PS: I know very little about how to use the Command Prompt.

    
asked by anonymous 13.04.2015 / 15:32

1 answer

4

Enter the project directory from the command line and run the following command:

composer update

If you already have the file composer.lock (which is where Composer saves the references to each of the dependencies that are in the project), run the following command:

composer install

The command above depends heavily on the composer being available globally from the command line or not. You may prefer to download the Composer executable in the project itself with one of the following commands:

curl -sS https://getcomposer.org/installer | php

Or, if you do not have curl :

php -r "readfile('https://getcomposer.org/installer');" | php

And then just replace composer with composer.phar , which is the name of the downloaded file.

    
13.04.2015 / 15:51