Composer无法使用zfc-user-doctrine-orm进行更新

时间:2013-07-09 18:04:41

标签: doctrine-orm zend-framework2 composer-php zfcuser

我有以下composer.json

{
    "name": "zendframework/skeleton-application",
    "description": "Skeleton Application for ZF2",
    "license": "BSD-3-Clause",
    "keywords": [
        "framework",
        "zf2"
    ],
    "homepage": "http://framework.zend.com/",
    "require": {
        "php": ">=5.3.3",
        "zendframework/zendframework": "2.2.*",
        "doctrine/doctrine-orm-module": "*",
        "bjyoungblood/bjy-authorize": "1.2.*",
        "zf-commons/zfc-user": "dev-master",
        "zendframework/zend-developer-tools": "*",
        "zendframework/zftool": "dev-master",
        "swiftmailer/swiftmailer" : "*",
        "mwillbanks/zfc-twitter-bootstrap": "*"
    }
}

在我添加了需求zf-commons/zfc-user-doctrine-orm后,Composer无法执行命令composer update,提供了大量错误消息:

composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Installation request for zf-commons/zfc-user dev-master -> satisfiable by
zf-commons/zfc-user[dev-master].
- Conclusion: don't install zf-commons/zfc-user 0.1.2
- Conclusion: remove zendframework/zendframework 2.2.0
- zf-commons/zfc-user 0.0.1 requires zendframework/zendframework 2.0.* -> sa
tisfiable by zendframework/zendframework[2.0.0, 2.0.0rc1, 2.0.0rc2, 2.0.0rc3, 2.
0.0rc4, 2.0.0rc5, 2.0.0rc6, 2.0.0rc7, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.0.6,
2.0.7, 2.0.8].
- zf-commons/zfc-user-doctrine-orm 0.0.1 requires zendframework/zendframewor
k 2.0.* -> satisfiable by zendframework/zendframework[2.0.0, 2.0.0rc1, 2.0.0rc2,
2.0.0rc3, 2.0.0rc4, 2.0.0rc5, 2.0.0rc6, 2.0.0rc7, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2
.0.5, 2.0.6, 2.0.7, 2.0.8].
- zf-commons/zfc-user 0.1.0 requires zendframework/zendframework 2.1.* -> sa
tisfiable by zendframework/zendframework[2.1.0, 2.1.1, 2.1.2, 2.1.3, 2.1.4, 2.1.
5].
- zf-commons/zfc-user 0.1.1 requires zendframework/zend-view 2.1.* -> satisf
iable by zendframework/zendframework[2.1.0, 2.1.1, 2.1.2, 2.1.3, 2.1.4, 2.1.5],
zendframework/zend-view[2.1.0, 2.1.1, 2.1.2, 2.1.3, 2.1.4, 2.1.5].
- zf-commons/zfc-user-doctrine-orm 0.1.0 requires zendframework/zendframewor
k 2.1.* -> satisfiable by zendframework/zendframework[2.1.0, 2.1.1, 2.1.2, 2.1.3
, 2.1.4, 2.1.5].
- Can only install one of: zendframework/zendframework[2.2.0, 2.0.0].
- Can only install one of: zendframework/zendframework[2.2.0, 2.0.0rc1].
- Can only install one of: zendframework/zendframework[2.2.0, 2.0.0rc2].
- Can only install one of: zendframework/zendframework[2.2.0, 2.0.0rc3].
- Can only install one of: zendframework/zendframework[2.2.0, 2.0.0rc4].
- Can only install one of: zendframework/zendframework[2.2.0, 2.0.0rc5].
- Can only install one of: zendframework/zendframework[2.2.0, 2.0.0rc6].
- Can only install one of: zendframework/zendframework[2.2.0, 2.0.0rc7].
- Can only install one of: zendframework/zendframework[2.2.0, 2.0.1].
- Can only install one of: zendframework/zendframework[2.2.0, 2.0.2].
- Can only install one of: zendframework/zendframework[2.2.0, 2.0.3].
- Can only install one of: zendframework/zendframework[2.2.0, 2.0.4].
- Can only install one of: zendframework/zendframework[2.2.0, 2.0.5].
- Can only install one of: zendframework/zendframework[2.2.0, 2.0.6].
- Can only install one of: zendframework/zendframework[2.2.0, 2.0.7].
- Can only install one of: zendframework/zendframework[2.2.0, 2.0.8].
- Can only install one of: zendframework/zendframework[2.2.0, 2.1.0].
- Can only install one of: zendframework/zendframework[2.2.0, 2.1.1].
- Can only install one of: zendframework/zendframework[2.2.0, 2.1.2].
- Can only install one of: zendframework/zendframework[2.2.0, 2.1.3].
- Can only install one of: zendframework/zendframework[2.2.0, 2.1.4].
- Can only install one of: zendframework/zendframework[2.2.0, 2.1.5].
- don't install zendframework/zend-view 2.1.0|don't install zendframework/ze
ndframework 2.2.0
- don't install zendframework/zend-view 2.1.1|don't install zendframework/ze
ndframework 2.2.0
- don't install zendframework/zend-view 2.1.2|don't install zendframework/ze
ndframework 2.2.0
- don't install zendframework/zend-view 2.1.3|don't install zendframework/ze
ndframework 2.2.0
- don't install zendframework/zend-view 2.1.4|don't install zendframework/ze
ndframework 2.2.0
- don't install zendframework/zend-view 2.1.5|don't install zendframework/ze
ndframework 2.2.0
- Installation request for zendframework/zendframework == 2.2.0.0 -> satisfi
able by zendframework/zendframework[2.2.0].
- zf-commons/zfc-user-doctrine-orm 0.1.1 requires zf-commons/zfc-user 0.* ->
satisfiable by zf-commons/zfc-user[0.0.1, 0.1.0, 0.1.1, 0.1.2].
- Installation request for zf-commons/zfc-user-doctrine-orm * -> satisfiable
by zf-commons/zfc-user-doctrine-orm[0.0.1, 0.1.0, 0.1.1].

如何修复此错误消息?

3 个答案:

答案 0 :(得分:6)

你的作曲家文件对我来说很好。这可能是因为您使用的是zf-commons/zfc-user的dev-master而不是标记的版本号。

由于此Composer使用的是Composer缓存中存在的旧版本,而不是下载新版本。您可以使用旧版本告诉它,因为Composer指的是zf-commons/zfc-user 0.0.1,但当前版本是0.1.2。旧版本的zf-commons/zfc-user依赖于zendframework/zendframework旧版本,它与需要更新版本的其他模块发生冲突。

如果替换:

"zf-commons/zfc-user": "dev-master",

使用:

"zf-commons/zfc-user": "~0.1.2",

它应该强制Composer下载该模块的0.1.2或更新版本。

答案 1 :(得分:1)

2015年,这项工作对我来说很好

"zf-commons/zfc-user": "1.*",
"zf-commons/zfc-user-doctrine-orm": "^1.0"

答案 2 :(得分:0)

我遇到了同样的问题,所以我将dev-master的一些依赖项更改为它们的最新版本并且它有效。我的composer.json文件:

{
"name": "zendframework/skeleton-application",
"description": "Skeleton Application for ZF2",
"license": "BSD-3-Clause",
"keywords": [
    "framework",
    "zf2"
],
"homepage": "http://framework.zend.com/",
"require": {
    "php": ">=5.5",
    "zendframework/zendframework": "~2.5",
    "zendframework/zftool": "dev-master",
    "doctrine/doctrine-orm-module": "^0.10.0",
    "zendframework/zend-developer-tools": "dev-master",
    "bjyoungblood/bjy-profiler": "dev-master",
    "doctrine/migrations": "^1.4",
    "doctrine/orm": "^2.5",
    "rradutzu/zend2-doctrine-dynamic-db": "^0.0.4",
    "zf-commons/zfc-rbac" : "~2.4",
    "zf-commons/zfc-user": "1.4.4",
    "zf-commons/zfc-user-doctrine-orm": "^1.0.1"
}

}