azine/emailupdateconfirmation-bundle

Symfony 扩展包,用于要求用户通过点击发送到新邮箱地址的链接来确认更新邮箱地址。这应该是 FriendsOfSymfony/UserBundle 的一部分,但维护者没有接受作为新功能。

1.1.0 2019-03-20 13:57 UTC

README

Symfony 扩展包,允许使用基于 FOSUserBundle 的邮箱更改确认功能。

安装

使用 Composer 安装 AzineEmailUpdateConfirmationBundle,只需将以下内容添加到您的 composer.json 文件中

// composer.json
{
    // ...
    require: {
        // ...
        "azine/emailupdateconfirmation-bundle": "dev-master"
    }
}

然后,您可以通过在您的 composer.json 文件所在的目录中运行 Composer 的更新命令来安装新的依赖项

php composer.phar require azine/emailupdateconfirmation-bundle

现在,Composer 将自动下载所有必需的文件,并为您安装它们。接下来,您需要更新您的 AppKernel.php 文件,并注册新的扩展包

<?php
// in AppKernel::registerBundles()

$bundles = array(
    // ...
    new Azine\EmailUpdateConfirmationBundle\AzineEmailUpdateConfirmationBundle(),
    // ...
);

注册 AzineEmailUpdateConfirmationBundle 的路由

// in app/config/routing.yml

azine_email_update_confirmation_bundle:
    resource: "@AzineEmailUpdateConfirmationBundle/Resources/config/routing.yml"

配置选项

这是配置选项的完整列表,包括它们的默认值。

// app/config/config.yml
azine_email_update_confirmation:

    # enables email update confirmation functionality
    enabled:        true

    # determines the encryption mode for encryption of email value. openssl_get_cipher_methods(false) is default value.
    cypher_method:  null

    # mailer service
    mailer:         azine.email_update.mailer

    # email template file
    email_template: @AzineEmailUpdateConfirmation/Email/email_update_confirmation.txt.twig

    # route to redirect after email confirmation 
    redirect_route: fos_user_profile_show

    # "from" email address for the confirmation email. The default is the same email as configured for the password-reset emails sent by the FOSUserBundle
    from_email:     %fos_user.resetting.email.from_email%

贡献

非常欢迎贡献。请从仓库分叉并针对 master 分支提交您的 pull-request。

PR 应该

  • 包含对 PR 解决或添加到扩展包的描述(如果适用,请引用现有问题)
  • 包含干净的代码和一些内联文档和 phpdocs,没有“纯空白”更改。
  • 遵循 Symfony 最佳实践 和编码风格
  • 包含对新的功能或修复的 phpunit 测试
  • 在提交 PR 之前,确保您的分支在 travis-ci.org 上的构建结果为“绿色”

代码风格

您可以使用 php-cs-fixer 检查代码风格。可选地,您可以设置一个包含 php-cs-fixer 检查的 pre-commit 钩子。也请参阅 https://github.com/FriendsOfPHP/PHP-CS-Fixer

您只需将 pre-commit.sample 文件从 commit-hooks/ 移动到 .git/hooks/ 文件夹,并将其重命名为 pre-commit

php-cs-fixer 将在您每次提交时检查您添加的代码的风格,并对提交应用修复。

要手动运行 php-cs-fixer,请安装依赖项(composer install)并执行 php vendor/friendsofphp/php-cs-fixer/php-cs-fixer --diff --dry-run -v fix --config=.php_cs.dist .

构建状态 ec.

Build Status Total Downloads Latest Stable Version Scrutinizer Quality Score Code Coverage