forked from symfony/swiftmailer-bundle
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSwiftmailerBundle.php
43 lines (36 loc) · 1.44 KB
/
SwiftmailerBundle.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SwiftmailerBundle;
use Symfony\Bundle\SwiftmailerBundle\DependencyInjection\Compiler\EnsureNoHotPathPass;
use Symfony\Bundle\SwiftmailerBundle\DependencyInjection\Compiler\RegisterPluginsPass;
use Symfony\Component\Console\Application;
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
/**
* @author Fabien Potencier <[email protected]>
*/
class SwiftmailerBundle extends Bundle
{
public function build(ContainerBuilder $container)
{
parent::build($container);
$container->addCompilerPass(new RegisterPluginsPass());
// Older supported versions of Symfony don't have the parent class that EnsureNoHotPathPass extends from.
// But they don't have the hot_path optimization either, so not being able to register our pass is not an issue.
if (class_exists('Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass')) {
$container->addCompilerPass(new EnsureNoHotPathPass(), PassConfig::TYPE_AFTER_REMOVING);
}
}
public function registerCommands(Application $application)
{
// noop
}
}