kick-in / exception-handler-bundle
这个包集在您的Symfony应用程序中集成了简单的异常处理器,能够发送具体问题的邮件。
4.0.1
2024-08-20 17:40 UTC
Requires
- php: >=7.3
- symfony/config: ~4.4|~5.4|~6.3
- symfony/dependency-injection: ~4.4|~5.4|~6.3
- symfony/event-dispatcher: ~4.4|~5.4|~6.3
- symfony/filesystem: ~4.4|~5.4|~6.3
- symfony/http-foundation: ~4.4|~5.4|~6.3
- symfony/http-kernel: ~4.4|~5.4|~6.3
- symfony/security-core: ~4.4|~5.4|~6.3
- symfony/twig-bundle: ~4.4|~5.4|~6.3
Requires (Dev)
- symfony/mailer: ~4.4|~5.4|~6.3
- symfony/swiftmailer-bundle: >=2.6.0
Suggests
- symfony/mailer: When you want to use the Symfony Mailer, install this bundle
- symfony/swiftmailer-bundle: When you want to use Swiftmailer, install this bundle
Conflicts
- twig/twig: <2.7.0
README
这个包集在您的Symfony应用程序中集成了简单的异常处理器,能够发送具体问题的邮件。
升级
查看升级说明。
安装
为了让此包正常工作,您需要按照以下步骤操作
- 安装包
php composer.phar require kick-in/exception-handler-bundle
- 在您的
bundles.php
中启用包(如果未自动完成)
$bundles = [ Kickin\ExceptionHandlerBundle\KickinExceptionHandlerBundle::class => ['all' => true], ];
- 在配置中选择邮件后端。例如,对于SwiftMailer
kickin_exception_handler: mail_backend: 'swift' # One of "swift"; "swift_mailer"; "symfony"; "symfony_mailer"
-
实现您自定义的配置服务。这应该实现
Configuration\SwiftMailerConfigurationInterface
或
Configuration\SymfonyMailerConfigurationInterface
,具体取决于您的邮件后端选择。您可以在这里查看自定义示例实现。
-
如果您将
container.autowiring.strict_mode
设置为 false,则配置将自动绑定到正确的异常处理器。否则,(在Symfony >=4.0中默认如此),将Kickin\ExceptionHandlerBundle\Configuration\(Swift|Symfony\)MailerConfigurationInterface
服务别名到您的自定义配置类。例如
Kickin\ExceptionHandlerBundle\Configuration\SymfonyMailerConfigurationInterface: alias: 'App\ExceptionHandler\ExceptionHandlerConfiguration'
- [仅SwiftMailer] 创建
exception_mailer
SwiftMailer 实例。例如
swiftmailer: default_mailer: default mailers: default: transport: "%mailer_transport%" exception_mailer: transport: "%mailer_transport%" spool: { type: memory }
这就完成了,祝您异常邮件发送愉快!
贡献者
原始功能由WendoB创建,而BobV将代码库拆分成了独立的包,使其可供更多用户配置。
问题
如果您遇到任何问题,请不要犹豫,创建一个问题(或如果您能修复它,则创建一个PR)!