我在配置满足或作曲家时遇到问题。到目前为止,我已经设法做到了:
1:我创建了一个名为“common”的 SVN 存储库。有几个标签(1.0、1.1) - 每个标签都有自己的 composer.json 文件,例如:
{
"name": "acme/common",
"version": "1.0"
}
SVN 网址:http ://svn.local.acme.com/svn/common
2:我从 satis.json 创建了作曲家存储库:
{
"name": "Acme",
"homepage": "http://dev.local.acme.com/satis/web",
"repositories": [
{ "type": "vcs", "url": "http://svn.local.acme.com/svn/common" }
],
"require-all": true
}
它确实将所有标签拉入 web/packages.json:
{
"packages": {
"acme/common": {
"1.0": {
"name": "acme/common",
"version": "1.0",
"version_normalized": "1.0.0.0",
"source": {
"type": "svn",
"url": "http://svn.local.acme.com/svn/common",
"reference": "/tags/1.0/@2"
},
"type": "library"
},
"1.1": {
"name": "acme/common",
"version": "1.1",
"version_normalized": "1.1.0.0",
"source": {
"type": "svn",
"url": "http://svn.local.acme.com/svn/common",
"reference": "/tags/1.1/@5"
},
"type": "library"
}
}
}
}
满足网址:http ://dev.local.acme.com/satis/web
3:在我的项目中,我想在我的 composer.json 中要求“acme/common”(比如说 1.0):
{
"require": {
"acme/common": "1.0"
},
"repositories": [
{
"type": "composer",
"url": "http://dev.local.acme.com/satis/web"
}
]
}
它成功提取了 1.0 标签,但是如果我将要求更改为“1.1”并运行,composer.phar update
我会收到错误消息:
[RuntimeException]
Package could not be downloaded, svn: E195012: Path '.' does not share common version control ancestry with the requested switch location. Use --ignore-ancestry to disable this check.
svn: E195012: 'http://svn.local.acme.com/svn/common/tags/1.3' shares no common ancestry with '/home/user/acid.dev.local.acme.com/composer/vendor/acme/common'
我认为这里的问题是最初(作曲家安装)签出标签而不是导入导入。这个错误表明供应商目录是 SVN 版本的(它有 .svn 文件夹) - 我认为它不应该是。