我是从阿根廷写的,请原谅我的英语小。我在模块ZfcUser和zfcuserDoctrineORM. 我需要将它们集成到我的项目中。我正在使用 Zend 框架 2、教义 2.3 和 postgreSQL,这是我第一次使用这些工具。出于这个原因,有很多事情我不能很好地掌握,我的所有模块都包含在/config/application.config.php我的数据库中,我的连接配置在我的数据库中/config/autoload/local.php
本地.php
返回数组(
'教义' => 数组(
'连接' => 数组(
'orm_default' =>数组(
'driverClass' => 'Doctrine\DBAL\Driver\PDOPgSql\Driver',
'参数' => 数组(
'主机' => '本地主机',
'端口' => '5432',
'用户' => 'postgres',
'密码' => 'postgres',
'dbname' => 'ministerio',
)
)
)
),
);
应用程序.config.php
返回数组(
'模块' => 数组(
'应用',
'教义模块',
'DoctrineORMModule',
'Reeser', // 我的模块名称
'ZfcBase',
'Zfc用户',
'ZfcUserDoctrineORM',
),
'module_listener_options' =>数组(
'config_glob_paths' =>数组(
'config/autoload/{,*.}{global,local}.php',
),
'module_paths' =>数组(
'。/模块',
'。/小贩',
),
),
);
为了映射我的数据库,我使用了带有教义的注释,并且在我的模块中生成了我自己的实体用户。
我添加了配置档案zfcuser.global.php并zfcuserdoctrineorm.global.php在我的自动加载目录中,但我不知道如何配置它们以便档案识别我的实体。
进入zfcuser.global.php
'zend_db_adapter' => 'Zend\Db\Adapter\Adapter', // 应该注释掉吗?
'user_entity_class' => 'Reeser\Entity\User',
'login_redirect_route' => 'Reeser/index/index.phtml',
返回数组(
'zfcuser' => $settings, // 我如何配置这段代码?
'service_manager' =>数组(
'别名' => 数组(
'zfcuser_zend_db_adapter' => (isset($settings['zend_db_adapter'])) ?
$settings['zend_db_adapter']: 'Zend\Db\Adapter\Adapter',
),
),
);
进入zfcuserdoctrineorm.global.php
返回数组(
'教义' => 数组(
'驱动程序' => 数组(
'zfcuser_driver' =>数组(
'class' => 'Doctrine\ORM\Mapping\Driver\AnnotationDriver',
'缓存' => '数组',
'路径' => 数组(__DIR__ .'/../src/Reeser/Entity')
),
'orm_default' =>数组(
'驱动程序' => 数组(
'ZfcUser\Entity' => 'zfcuser_driver'
)
)
)
),
);
我看到该模块zfcuserDoctrineORM适用于 XML。该模块可以适应注释吗?如果这是可能的,我如何使我的实体用户适应这个模块?我应该修改哪些档案?