zf-commons / zfc-user-doctrine-orm
为 ZfcUser 的 Doctrine2 ORM 存储适配器。
2.0.1
2018-08-29 11:30 UTC
Requires
- php: >=5.3.3
- doctrine/doctrine-orm-module: ~1.0
- zf-commons/zfc-user: ~3.0
This package is not auto-updated.
Last update: 2024-09-14 13:12:50 UTC
README
版本 0.1.1 由 Kyle Spraggs 和 ZF-Commons 团队创建
简介
ZfcUserDoctrineORM 是 ZfcUser 的 Doctrine2 ORM 存储适配器。
选项
以下选项可用
- enable_default_entities - 布尔值,确定是否启用默认的用户实体。将其设置为 false 以使用自己的实体扩展 ZfcUser\Entity\User。默认为 true。
依赖
安装
设置 Doctrine ORM 的数据库连接设置
具体来说,转到 Doctrine 连接设置,并将示例配置文件内容复制/粘贴/修改到您的 config/autoload/doctrine.orm.local.php
。
安装 Zfc 组件
php composer.phar require zf-commons/zfc-user-doctrine-orm
在 config/application/application.config.php
中设置您的模块,例如
'modules' => array(
'DoctrineModule',
'DoctrineORMModule',
'ZfcBase',
'ZfcUser',
'ZfcUserDoctrineORM',
'Application',
),
现在,您可以使用 ZfcUser SQL 模式 来设置您的数据库表。
或者,您可以使用 doctrine-module
帮您完成这项工作
vendor/bin/doctrine-module orm:schema-tool:update --dump-sql
注意:如果您想使用不同的表模式或用户实体,您必须将 zfcuser 配置文件 中的 enable_default_entities
设置为 false
如果 SQL 看起来没问题,就做
vendor/bin/doctrine-module orm:schema-tool:update --force
现在您可以导航到 /user
,它应该可以正常工作。