https://packagist.phpcomposer.com
https://packagist.laravel-china.org
composer config -g repo.packagist composer https://packagist.phpcomposer.com
$ composer config -l
[repositories.packagist.org.type] composer
[repositories.packagist.org.url] https://packagist.phpcomposer.com
[process-timeout] 300
[use-include-path] false
[preferred-install] auto
[notify-on-install] true
[github-protocols] [https, ssh]
[vendor-dir] vendor (F:\java\Servlet\demo1\1/vendor)
[bin-dir] {$vendor-dir}/bin (F:\java\Servlet\demo1\1/vendor/bin)
[cache-dir] C:/Users/TOYOTA/AppData/Local/Composer
[data-dir] C:/Users/TOYOTA/AppData/Roaming/Composer
[cache-files-dir] {$cache-dir}/files (C:/Users/TOYOTA/AppData/Local/Composer/files)
[cache-repo-dir] {$cache-dir}/repo (C:/Users/TOYOTA/AppData/Local/Composer/repo)
[cache-vcs-dir] {$cache-dir}/vcs (C:/Users/TOYOTA/AppData/Local/Composer/vcs)
[cache-ttl] 15552000
[cache-files-ttl] 15552000
[cache-files-maxsize] 300MiB (314572800)
[bin-compat] auto
[discard-changes] false
[autoloader-suffix]
[sort-packages] false
[optimize-autoloader] false
[classmap-authoritative] false
[apcu-autoloader] false
[prepend-autoloader] true
[github-domains] [github.com]
[bitbucket-expose-hostname] true
[disable-tls] false
[secure-http] true
[cafile]
[capath]
[github-expose-hostname] true
[gitlab-domains] [gitlab.com]
[store-auths] prompt
[archive-format] tar
[archive-dir] .
[htaccess-protect] 1
[home] C:/Users/TOYOTA/AppData/Roaming/Composer
repositories.packagist.org.url
已经发生改变,证明配置成功,–global (-g)【全局】实际操作的是$COMPOSER_HOME/config.json
进入项目目录 运行以下命令
composer config repo.packagist composer https://packagist.phpcomposer.com
上述命令将会在当前项目中的
composer.json
文件的末尾自动添加镜像的配置信息(你也可以自己手工添加):
"repositories": {
"packagist": {
"type": "composer",
"url": "https://packagist.phpcomposer.com"
}
}
composer global require slince/composer-registry-manager
$ composer repo:ls
composer https://packagist.org
* phpcomposer https://packagist.phpcomposer.com
composer-proxy https://packagist.composer-proxy.org
laravel-china https://packagist.laravel-china.org
标“*”表示当前正在使用的源;
composer repo:use laravel-china