Home  >  Article  >  Development Tools  >  Explanation of common composer commands

Explanation of common composer commands

藏色散人
藏色散人forward
2019-11-02 13:54:532698browse

The following column composer tutorial will give you simple common composer commands. I hope it will be helpful to friends in need!

Explanation of common composer commands

Composer common command explanation

composer install - If there is a composer.lock file, install it directly, otherwise install it from composer.json The latest extension package and dependencies;

composer update - install the latest extension package and dependencies from composer.json;

composer update vendor/package - configure from composer.json or the corresponding package, and update to the latest;

composer require new/package - add and install new/package, you can specify the version, such as: composer require new/package ~2.5

Related introduction:

Composer is a dependency management tool for PHP5.3 and above. It allows you to declare the code libraries your project depends on and it will install them for you in your project. Composer is not a package manager. Yes, it involves "packages" and "libraries", but it's managed on a per-project basis, with installations in some directory within your project (e.g. vendor). By default it won't install anything globally. So this is just a dependency management.

For more composer-related knowledge, please visit composer commandUsage tutorial column: https://www.php.cn/tool/composer/

The above is the detailed content of Explanation of common composer commands. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:segmentfault.com. If there is any infringement, please contact admin@php.cn delete