Php composer tool quick tutorial, super simple, composer tutorial
The php dependency management tool is used to process packages or libraries. It is saved in the vender folder of a project based on a single project. It is never installed globally by default. Php 5.3.2 + is required, and git, svn, and hg are required for resource package installation.
1. Download composer. phar to your project directory. It is a project package file containing AutoloadGenerator, ClassMapGenerator, etc. https://getcomposer.org/download/, which can be directly downloaded under manual Download or run the command
Curl-sS https://getcomposer.org/installer | php
2. run php composer. phar, you can get the version information of composer, and some commands 3. Create composer. json file, which declares dependency, which is a bit similar to npm 4. Use the command composer. install, download the dependency package, usually under the vender directory, and generate composer. lock file, which is used to lock the dependent package version. When composer. when the lock file exists and the composer install command is executed, the composer will update according to composer. the specified package version in lock is installed. If you execute composer update, the package version is updated and composer is updated. lock file. 5. The composer has an automatic loading mechanism, which directly introduces require 'vendor/autoload. php'; 6. http://docs.phpcomposer.com/00-intro.html.
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.