Usage:
There are two ways to enable this mirroring service:
- Add the following configuration information to the Composer configuration file Config.json (System global Configuration). See "Example 1"
- Add the following configuration information to your project's Composer.json file (configured for a single project). See "Example 2"
in order to avoid the installation of the package two times to execute the query, remember to add the disabled packagist settings, as follows:
{" repositories": [ {"type": "Composer", "url": "http://pkg.phpcomposer.com/repo/packagist/"}, {" Packagist ": false} " }
Example 1, modifying the composer configuration file
View Composer Home directory: composer config -l -g
commands allow you to list composer global configuration information in which the [home]
configuration entry is the home directory of composer. Linux users please execute the sudo composer config -l -g
command.
Enter the composer home directory, open the Config.json file (if you do not create one yourself), and then increase the configuration information for this image service, the final content is as follows:
{ "config": { }, "repositories": [ {"type": "Composer", "url": "http://pkg.phpcomposer.com/repo/ packagist/"}, {" Packagist ": false} ] }
Example 2, with the Laravel project's Composer.json configuration file as an example, add this image service configuration information as follows (note the last few lines):
{"Name": "Laravel/laravel", "description": "The Laravel Framework.", "keywords": ["Framework", "Laravel"], "license": "MIT", "type": "Project", "require": { "Laravel/framework": "4.2.*"}, "AutoLoad": {"Classmap": ["AP P/commands "," App/controllers "," App/models "," App/database/migra tions "," app/database/seeds "," app/tests/testcase.php "]} , "scripts": {"Post-install-cmd": ["PHP Artisan clear-compiled", "PHP artisan Optimize"], "post-update-cmd": ["PHP artisan Clea R-compiled "," PHP artisan optimize "]," post-create-project-cmd ": [ "PHP ArtisAn key:generate "]}," config ": {" Preferred-install ":" Dist " }, "minimum-stability": "Stable", "repositories": [{"Type": "Composer", "url": "H ttp://pkg.phpcomposer.com/repo/packagist/"}, {" Packagist ": false}]}
The above describes the composer update is not successful, enable the configuration of the domestic mirror site change method, including the content, I hope that the PHP tutorial interested in a friend to help.