Before written related to the composer, then met a few friends asked me, I tidied up a bit, convenient for everyone to check in the future ~ ~ Do not play open source programmer is not a good cook
1. Perform online installation CURL-SS Https://getcomposer.org/installer | php Execution results are as follows: > > #!/usr/bin/env php all settings C Orrect for using Composer downloading ... > >composer successfully installed to:/root/composer.phar > >use it: PHP composer.phar 2. To check if composer is working properly, just use to perform phar:php composer.phar 3. MV Composer.phar/usr/local/bin/composer composer-v 4. Install dependencies (enter the desired project) create a Composer.json file, write the appropriate package name and version number, as { "Require": {"Monolog/monolog": "1.0.*"  }} execute composer install, Into the automatic installation, after the installation is completed will generate a Composer.lock file, which is a specific version number name, need this file and Composer.json submitted to the version management together (if you want to update dependent execution composer update If you want to update only part composer update mongolog/monolog) 5. Configure the Mirror package in the country set mirror address (Chinese mirror address-G parameter indicates global configuration) composer Config-g Repo . packagist composer HTtps://packagist.phpcomposer.com set Process Execution time-out (in seconds) composer Config-g process-timeout 600 view configuration list com Poser config-g-l 6. Automatic loading mechanism require ' vendor/autoload.php ' should be introduced in the program; 7. Then use it in PHP like this: $log = new Monolog\logger (' name '); $log->pushhandler (New Monolog\handler\streamhandler (' App.log ', monolog\logger::warning)); $log->addwarning (' Foo '); 8. The above references a monolog/monolog package, but if you want to add additional packages such as Add Dubbo Development extension Package composer require quickj/ Dubbo-php-client can be so easy, move your hands, together high~~~
PHP uses composer