PHP之composer使用国内镜像

程序猿 2021-02-25 14:12:16 1805浏览 加载中

方法一 命令行

composer config -g repo.packagist composer https://packagist.phpcomposer.com

方法二修改json文件

composer config repo.packagist composer https://packagist.phpcomposer.com
会自动添加
"repositories": {
"packagist": {
"type": "composer",
"url": "https://packagist.phpcomposer.com"
}
}
laravel的例子
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.2.*"
},
"config": {
"preferred-install": "dist"
},
"repositories": {
"packagist": {
"type": "composer",
"url": "https://packagist.phpcomposer.com"
}
}
}


标签: composer
最后修改:2024-12-10 10:39:12

非特殊说明,本博所有文章均为博主原创。