Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Composer list packages with installed version and latest version

Tags:

composer-php

As in the title, is there any command that can list installed packages and the latest version of those packages together?


edit:

php composer.phar show 

this show all available packages and also installed packages with installed version only

php composer.phar show [package] 

this can get both installed version and latest version, but it is inconvenience if many packages are installed

like image 217
Laz Avatar asked Aug 28 '15 03:08

Laz


People also ask

How do I see what packages are installed on composer?

You can run composer show -i (short for --installed ). In the latest version just use composer show .

How do you list a composer?

Composers. Every composer's name should be given in its proper form, correctly spelled, and with birth and death dates. If a composer appears more than once on your program, use only his/her last name (with no dates) after the first appearance.

How do I update the composer package to the latest version?

To update your packagesNavigate to the root of your git repo, where your composer. json file is. Run composer update (on your local machine) to update the required packages and re-generate a composer.

Where does composer install global packages?

composer/vendor/ directory and, most importantly, the phpunit CLI tools are installed into ~/. composer/vendor/bin/.


2 Answers

Since Composer v1.1 (May 2016) you can run

composer outdated

like image 183
daker Avatar answered Dec 04 '22 09:12

daker


As the current version of composer -i option which tells composer to show only the installed version is deprecated.

So if you want to show only the installed version of a package, the syntax is:

composer show "package-name" 

If you need to pull all available versions of the package, use --all option like this:

composer show "phpunit/phpunit" --all  
like image 29
Amaynut Avatar answered Dec 04 '22 09:12

Amaynut