我是从阿根廷写的,请原谅我的英语水平有限。我在使用模块时遇到一些问题ZfcUser
and zfcuserDoctrineORM
。我需要将它们集成到我的项目中。我正在使用 Zend Framework 2、doctrine 2.3 和 postgreSQL,这是我第一次使用这些工具。因此,有很多东西我不太掌握,我把所有模块都包含在我的/config/application.config.php
我的连接是在我的数据库中配置的/config/autoload/local.php
本地.php
return array(
'doctrine' => array(
'connection' => array(
'orm_default' =>array(
'driverClass' => 'Doctrine\DBAL\Driver\PDOPgSql\Driver',
'params' => array(
'host' => 'localhost',
'port' => '5432',
'user' => 'postgres',
'password' => 'postgres',
'dbname' => 'ministerio',
)
)
)
),
);
应用程序配置.php
return array(
'modules' => array(
'Application',
'DoctrineModule',
'DoctrineORMModule',
'Reeser', // Name of my module
'ZfcBase',
'ZfcUser',
'ZfcUserDoctrineORM',
),
'module_listener_options' =>array(
'config_glob_paths' =>array(
'config/autoload/{,*.}{global,local}.php',
),
'module_paths' =>array(
'./module',
'./vendor',
),
),
);
为了映射我的数据库,我使用了带有学说的注释,并且我在我的模块中生成了自己的实体用户。
我添加了配置存档zfcuser.global.php
and zfcuserdoctrineorm.global.php
在我的自动加载目录中,但我不知道如何配置它们以便档案识别我的实体。
Into zfcuser.global.php
'zend_db_adapter' => 'Zend\Db\Adapter\Adapter', // should this comment it?
'user_entity_class' => 'Reeser\Entity\User',
'login_redirect_route' => 'Reeser/index/index.phtml',
return array(
'zfcuser' => $settings, // How I configure this code?
'service_manager' =>array(
'aliases' => array(
'zfcuser_zend_db_adapter' => (isset($settings['zend_db_adapter'])) ?
$settings['zend_db_adapter']: 'Zend\Db\Adapter\Adapter',
),
),
);
Into zfcuserdoctrineorm.global.php
return array(
'doctrine' => array(
'driver' => array(
'zfcuser_driver' =>array(
'class' => 'Doctrine\ORM\Mapping\Driver\AnnotationDriver',
'cache' => 'array',
'paths' => array(__DIR__ .'/../src/Reeser/Entity')
),
'orm_default' =>array(
'drivers' => array(
'ZfcUser\Entity' => 'zfcuser_driver'
)
)
)
),
);
我看到了那个模块zfcuserDoctrineORM
使用 XML。
该模块可以适应注释吗?如果可能的话,我如何使我的实体用户适应此模块?我应该修改哪些档案?