1, download composer:
Curl-ss Https://getcomposer.org/installer | Php
2, installation composer:
/usr/bin/php Composer.phar--version
3. Set global command
sudo mv Composer.phar/usr/local/bin/composer
4. View version:
Composer-version
5, composer will prompt you a lot of orders
6. The init command can Configuration Package name, Description, Author, Minimum, Package Type, License, dependencies, and dev dependencies information.
Composer Init
After you complete this information, create your own package
7, oh yes, you can search
Composer Search Package
8, can show
Composer Show-all Bag
9, use the install need to configure the JSON file first.
We first add a Monolog/monolog dependency library to the Composer.json configuration, as follows:
{
"name": "Test/test", "
description": "Test init",
"type": "Library",
"license": "License Description ",
" authors ": [
{
" name ":" Mayanlong ",
" email ":" json_vip@163.com "
}
],
"Require": {
"Monolog/monolog": "1.21.*",
}
}
Then install dependencies by using the following command
$ composer Install
10, update (updated)
If we add or remove a dependency, we can update it with the following command
$ composer Update
11. Require (affirm Reliance)
We can also add dependencies directly to the command, which is automatically downloaded when the command is executed, as follows:
$ composer require symfony/http-foundation
12, in fact, I mainly want to engage in that phpsipder, did not expect to get a pass this ...