Managing Composer Dependencies

Asked

Viewed 177 times

1

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

PS: I know very little about using Command Prompt.

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 references to each of the dependencies that are in the project), run the following command:

composer install

The above command depends a lot on whether Poser is globally available 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 haven’t curl:

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

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

  • Can you show me how to enter the directory? The path is this C: -> wamp -> www -> crm.

  • 1

    The command is cd c:\wamp\www\crm. Anything, go using the key tab to each directory to see the sub-directories from the point you are to facilitate navigation :)

  • Thanks for the help!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.