我对php composer的了解仅仅是基本的,但是...我已经下载并安装了Zend Framework3.0.0dev MVC skeleton app,并想知道是否可以随同它一起安装Doctrine ORM module。composer require doctrine/doctrine-orm-module抱怨
Problem 1
- Installation request for doctrine/doctrine-orm-module ^0.10.0 -> satisfiable by doctrine/doctrine-orm-module[0.10.0].
- doctrine/doctrine-orm-module 0.10.0 requires zendframework/zend-mvc ~2.3 -> satisfiable by zendframework/zend-mvc[2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.3.5, 2.3.6, 2.3.7, 2.3.8, 2.3.9, 2.4.0, 2.4.0rc1, 2.4.0rc2, 2.4.0rc3, 2.4.0rc4, 2.4.0rc5, 2.4.0rc6, 2.4.0rc7, 2.4.1, 2.4.10, 2.4.2, 2.4.3, 2.4.4, 2.4.5, 2.4.6, 2.4.7, 2.4.8, 2.4.9, 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.6.0, 2.6.1, 2.6.2, 2.6.3, 2.7.0, 2.7.1, 2.7.10, 2.7.2, 2.7.3, 2.7.4, 2.7.5, 2.7.6, 2.7.7, 2.7.8, 2.7.9] but these conflict with your requirements or minimum-stability.所以我尝试在composer.json中将zendframework/zend-mvc降级到2.7.9,然后再试一次:
Problem 1
- The requested package zendframework/zend-mvc (installed at 3.0.1, required as 2.7.9) is satisfiable by zendframework/zend-mvc[3.0.1] but these conflict with your requirements or minimum-stability.
Problem 2
- zendframework/zend-mvc 2.7.9 conflicts with zendframework/zend-router[3.0.2].
- zendframework/zend-mvc 2.7.9 conflicts with zendframework/zend-router[3.0.2].
- Installation request for zendframework/zend-mvc 2.7.9 -> satisfiable by zendframework/zend-mvc[2.7.9].
- Installation request for zendframework/zend-router (installed at 3.0.2) -> satisfiable by zendframework/zend-router[3.0.2].我怀疑我不能让composer高兴的原因是这是不能做到的--也就是说,主义或模块(到目前为止)与ZF3不兼容。是真的吗?
发布于 2016-06-30 02:52:49
DoctrineORMModule 1.1.0和DoctrineModule 1.2.0已经发布。这些最终应该会增加ZF3兼容性。
发布于 2016-07-05 22:29:14
问题1
- Installation request for doctrine/doctrine-orm-module ^0.11.0 -> satisfiable by doctrine/doctrine-orm-module[0.11.0].
- doctrine/doctrine-orm-module 0.11.0 requires zendframework/zend-mvc ^2.5.2 -> satisfiable by zendframework/zend-mvc[2.5.2, 2.5.3, 2.6.0, 2.6.1, 2.6.2, 2.6.3, 2.7.0, 2.7.1, 2.7.10, 2.7.2, 2.7.3, 2.7.4, 2.7.5, 2.7.6, 2.7.7, 2.7.8, 2.7.9] but these conflict with your requirements or minimum-stability.作曲家需要原则/原则-orm-module
在zf3-上安装
发布于 2016-07-06 03:08:20
有一个包container-interop-doctrine可用,它与Zend Service Manger兼容(由于容器互操作兼容性)。
安装和使用与doctrine/doctrine-orm-module非常相似
composer require dasprid/container-interop-doctrine可以通过创建新文件data/config/autoload/doctrine.global.php来激活它
<?php
use ContainerInteropDoctrine\EntityManagerFactory;
return [
'dependencies' => [
'factories' => [
'doctrine.entity_manager.orm_default' => EntityManagerFactory::class,
],
],
/**
* For full configuration options, see
* https://github.com/DASPRiD/container-interop-doctrine/blob/master/example/full-config.php
*/
'doctrine' => [
'connection' => [
'orm_default' => [
'params' => [
'url' => 'mysql://user:password@localhost/database',
],
],
],
'driver' => [
'orm_default' => [
'class' => \Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain::class,
'drivers' => [
'App\Entity' => 'my_entity',
],
],
'my_entity' => [
'class' => \Doctrine\ORM\Mapping\Driver\AnnotationDriver::class,
'cache' => 'array',
'paths' => 'src/App/Entity/',
],
],
],
];激活后,您可以使用与doctrine-orm-module几乎相同的方式获取EntityManger
$serviceLocator->get('doctrine.entity_manager.orm_default');唯一值得注意的变化是,用entity_manger代替了enititymanager。
还有一个用于安装/使用的blog-post。
https://stackoverflow.com/questions/38103803
复制相似问题