dcs / password-reset-core-bundle
此包提供执行完整密码更改请求流程的逻辑
dev-master / 1.0.x-dev
2017-01-12 14:05 UTC
Requires
- php: >=5.3.9
- ramsey/uuid: ^3.3
Requires (Dev)
- dcs/user-core-bundle: ~1.0@dev
- phpunit/phpcov: 3.*
- phpunit/phpunit: ^5
- satooshi/php-coveralls: ~1.0
- symfony/framework-bundle: ~2.8|~3.0
- symfony/security: ~2.8|~3.0
Suggests
- dcs/password-reset-explain-view-bundle: Provides the visual display of password recovery services through view and form
- dcs/password-reset-persistence-orm-bundle: Provides the implementation of the persistence on database using Doctrine ORM of all password requests
This package is not auto-updated.
Last update: 2024-09-14 19:14:43 UTC
README
DCSPasswordResetCoreBundle
此包提供工具和通用逻辑来管理通过整合 DCSUserCoreBundle 的密码重置功能。
它通过特定事件提供了诸如保存和搜索单个重置请求等操作的抽象。
注意:此包不提供操作的最终实现,但您必须添加和配置库(或创建自己的库)以确保命令的执行。
安装
先决条件
此版本包需要 Symfony 2.8+。
您还必须安装和配置 DCSUserCoreBundle。
需要此包
运行以下命令
$ composer require dcs/password-reset-core-bundle "~1.0@dev"
Composer 将将包安装到您的项目的 vendor/dcs/password-reset-core-bundle
目录。
启用包
在内核中启用包
<?php
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new DCS\PasswordReset\CoreBundle\DCSPasswordResetCoreBundle(),
// ...
);
}
创建您的 ResetRequest 类
到目前为止,他没有谈论过 持久性。这是为什么?为什么 DCSPasswordResetCoreBundle 不知道它们将如何实现 Save 方法。它允许完全的自由实现。
配置
现在您已正确启用了此包,下一步是配置它以适应您应用程序的特定需求。
将以下配置添加到您的 config.yml
。
dcs_password_reset_core:
model_class: Your\ResetRequest\Class
repository_service: your_repository_service
完整配置
完整配置包括其他可以更改的参数
dcs_password_reset_core:
# mandatory parameters
model_class: Your\ResetRequest\Class
repository_service: your_repository_service
# optional parameters
waiting_time_new_request: 86400 # waiting time before a new request
token_ttl: 86400 # life time of the token
services:
token_generator: dcs_password_reset.service.token_generator.random # service to generate the token
date_time_generator: dcs_password_reset.service.date_time_generator.generic # service to generate the date
事件
完整的事件列表位于类 DCS\PasswordReset\CoreBundle\DCSPasswordResetCoreEvents 中。
DCSPasswordReset 包
提供了两个可安装的包
DCSPasswordResetPersistenceORMBundle 此包通过 DoctrineORM 提供了持久性的最终实现。
DCSPasswordResetExplainViewBundle 此包提供了通过视图和表单显示密码恢复服务的设置。
报告问题或功能请求
问题和功能请求在 Github 问题跟踪器 中进行跟踪。