问题
i am trying to use bjy-authorize, zfcUser and zfc-user-doctrine-orm in ZF2 using the composer. But i always get an error, when i call composer.phar update.
the composer.json looks as follows:
{
"name": "zendframework/skeleton-application",
"description": "Skeleton Application for ZF2",
"license": "BSD-3-Clause",
"keywords": [
"framework",
"zf2"
],
"homepage": "http://framework.zend.com/",
"minimum-stability": "alpha",
"require": {
"php": ">=5.3.3",
"zendframework/zendframework": "2.*",
"doctrine/doctrine-orm-module": "dev-master",
"bjyoungblood/bjy-authorize": "dev-master",
"zf-commons/zfc-base": "dev-master",
"zf-commons/zfc-user": "dev-master",
"zf-commons/zfc-user-doctrine-orm": "dev-master"
}
}
I tried it without the last 3 lines (starting with "zf-commons) The i get no error, but the zfc-user-doctrine module is not installed.
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Conclusion: don't install zf-commons/zfc-base 0.0.1
- Conclusion: remove bjyoungblood/bjy-authorize dev-master|install zf-commons/zfc-base 0.0.1
- Conclusion: don't install bjyoungblood/bjy-authorize dev-master|remove zf-commons/zfc-base dev-master|install zf-commons/zfc-base 0.0.1
- Installation request for bjyoungblood/bjy-authorize dev-master -> satisfiable by bjyoungblood/bjy-authorize dev-master.
- bjyoungblood/bjy-authorize dev-master requires zf-commons/zfc-user dev-master -> satisfiable by zf-commons/zfc-user dev-master, zf-commons/zfc-user dev-master.
- zf-commons/zfc-user dev-master requires zf-commons/zfc-base 0.* -> satisfiable by zf-commons/zfc-base 0.0.0, zf-commons/zfc-base 0.0.1, zf-commons/zfc-base 0.1.0.
- zf-commons/zfc-user dev-master requires zf-commons/zfc-base 0.* -> satisfiable by zf-commons/zfc-base 0.0.0, zf-commons/zfc-base 0.0.1, zf-commons/zfc-base 0.1.0.
- Can only install one of: zf-commons/zfc-base dev-master, zf-commons/zfc-base 0.0.0.
- Can only install one of: zf-commons/zfc-base dev-master, zf-commons/zfc-base 0.1.0.
- Installation request for zf-commons/zfc-base dev-master -> satisfiable by zf-commons/zfc-base dev-master
What do i have to change in the composer.json file?
Best, iceman
回答1:
You can fix your composer.json
as following:
{
"require": {
"php": ">=5.3.3",
"zendframework/zendframework": "2.*",
"doctrine/doctrine-orm-module": "~0.7",
"bjyoungblood/bjy-authorize": "~1.1",
"zf-commons/zfc-user": "~0.1",
"zf-commons/zfc-user-doctrine-orm": "~0.1"
}
}
Avoid using dev-master
if you don't know what you're doing.
回答2:
The problem is that Zf-Commons have started tagging their releases. If I were you I'd remove zfc-user, zfc-base, and doctrine-orm-module.
Change bjy-authorize's version from dev-master to 1.* and zfc-user-doctrine-orm to 0.*. Composer should then handle the dependencies from there.
来源:https://stackoverflow.com/questions/14776003/composer-json-for-bjy-authorize-zfcuser-and-zfc-user-doctrine-orm-in-zf2