我尝试从Github(designmodo/flat-ui)添加存储库,使用config并获取错误。
我在配置中犯了什么错误:
"repositories": {
"flat-ui": {
"type": "package",
"package": {
"name": "designmodo/Flat-UI",
"version": "1.3.0", // Don't know is it important? Where get this number in repo?
"source": {
"url": "https://github.com/designmodo/Flat-UI",
"type": "git",
"reference": "dev-master" // reference is branch name?
}
}
}
},
"require": {
"twbs/bootstrap-sass": "~3.2",
"designmodo/Flat-UI": "dev-master" // branch again (/minimum-stability?)
},
在某个时候,作曲家下载了软件包,但返回了错误(我不知道他什么时候下载的,我在供应商文件夹中查找,designmodo文件夹就在那里)。
最佳答案
问题解决了。在reference
部分中播放并将master
更改为*
并将版本更改为任意"designmodo/Flat-UI": "*"
。之后,作曲家通过git下载软件包并更新composer.lock
应该适用于任何Github回购。
工作配置:
{
"repositories": {
"flat-ui": {
"type": "package",
"package": {
"name": "designmodo/Flat-UI",
"version": "1.3.0",
"source": {
"url": "https://github.com/designmodo/Flat-UI",
"type": "git",
"reference": "master"
}
}
}
},
"require": {
"twbs/bootstrap-sass": "~3.2",
"designmodo/Flat-UI": "*"
},
}
https://getcomposer.org/doc/05-repositories.md