Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ class FrameworkExtension extends Extension
private $messengerConfigEnabled = false;
private $mailerConfigEnabled = false;
private $httpClientConfigEnabled = false;
private $notifierConfigEnabled = false;

/**
* Responds to the app.config configuration parameter.
Expand Down Expand Up @@ -372,7 +373,7 @@ public function load(array $configs, ContainerBuilder $container)
$this->registerMailerConfiguration($config['mailer'], $container, $loader);
}

if ($this->isConfigEnabled($container, $config['notifier'])) {
if ($this->notifierConfigEnabled = $this->isConfigEnabled($container, $config['notifier'])) {
$this->registerNotifierConfiguration($config['notifier'], $container, $loader);
}

Expand Down Expand Up @@ -637,6 +638,10 @@ private function registerProfilerConfiguration(array $config, ContainerBuilder $
$loader->load('http_client_debug.php');
}

if ($this->notifierConfigEnabled) {
$loader->load('notifier_debug.php');
}

$container->setParameter('profiler_listener.only_exceptions', $config['only_exceptions']);
$container->setParameter('profiler_listener.only_master_requests', $config['only_master_requests']);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use Symfony\Component\Notifier\Channel\SmsChannel;
use Symfony\Component\Notifier\Chatter;
use Symfony\Component\Notifier\ChatterInterface;
use Symfony\Component\Notifier\EventListener\NotificationLoggerListener;
use Symfony\Component\Notifier\EventListener\SendFailedMessageToNotifierListener;
use Symfony\Component\Notifier\Message\ChatMessage;
use Symfony\Component\Notifier\Message\SmsMessage;
Expand Down Expand Up @@ -101,5 +102,8 @@
->set('texter.messenger.sms_handler', MessageHandler::class)
->args([service('texter.transports')])
->tag('messenger.message_handler', ['handles' => SmsMessage::class])

->set('notifier.logger_notification_listener', NotificationLoggerListener::class)
->tag('kernel.event_subscriber')
;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\DependencyInjection\Loader\Configurator;

use Symfony\Component\Notifier\DataCollector\NotificationDataCollector;

return static function (ContainerConfigurator $container) {
$container->services()
->set('notifier.data_collector', NotificationDataCollector::class)
->args([service('notifier.logger_notification_listener')])
;
};