这取决于composer.json
文件的内容。
例如,如果您composer.json
只包含
{
"require": {
"phpunit/phpunit": "3.8.*@dev"
}
}
然后composer搜索packagist,在这里找到phpunit:
https://packagist.org/packages/phpunit/phpunit
它告诉作曲家从这里加载 phpunit:
https://github.com/sebastianbergmann/phpunit.git
相反,如果你composer.json
包含
{
"repositories": [
{
"type": "vcs",
"url": "http://github.com/sebastianbergmann/phpunit"
}
],
"require": {
"phpunit/phpunit": "3.8.*@dev"
}
}
那么composer就不会去找packagist,而是直接去github下载repo。
在 Packagist 上注册的包通常是包的“权威”版本(不是 fork),但我发现有几个情况并非如此,所以你应该检查它以确保你正在拉取你期望的包。