1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of the Superdesk Web Publisher Core Bundle. |
5
|
|
|
* |
6
|
|
|
* Copyright 2015 Sourcefabric z.u. and contributors. |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please see the |
9
|
|
|
* AUTHORS and LICENSE files distributed with this source code. |
10
|
|
|
* |
11
|
|
|
* @copyright 2015 Sourcefabric z.ú |
12
|
|
|
* @license http://www.superdesk.org/license |
13
|
|
|
*/ |
14
|
|
|
|
15
|
|
|
namespace SWP\Bundle\CoreBundle; |
16
|
|
|
|
17
|
|
|
use SWP\Bundle\CoreBundle\DependencyInjection\Compiler\AddCustomTwigCachePass; |
18
|
|
|
use SWP\Bundle\CoreBundle\DependencyInjection\Compiler\OrganizationThemesProviderPass; |
19
|
|
|
use SWP\Bundle\CoreBundle\DependencyInjection\Compiler\OverrideArticleBodyProcessorPass; |
20
|
|
|
use SWP\Bundle\CoreBundle\DependencyInjection\Compiler\OverrideArticleSourceAdderPass; |
21
|
|
|
use SWP\Bundle\CoreBundle\DependencyInjection\Compiler\OverrideContainerProviderPass; |
22
|
|
|
use SWP\Bundle\CoreBundle\DependencyInjection\Compiler\OverrideDynamicRouterPass; |
23
|
|
|
use SWP\Bundle\CoreBundle\DependencyInjection\Compiler\OverrideMediaManagerPass; |
24
|
|
|
use SWP\Bundle\CoreBundle\DependencyInjection\Compiler\OverridePackagePreviewTokenFactoryPass; |
25
|
|
|
use SWP\Bundle\CoreBundle\DependencyInjection\Compiler\OverrideSettingsManagerPass; |
26
|
|
|
use SWP\Bundle\CoreBundle\DependencyInjection\Compiler\OverrideTemplatesSystemPass; |
27
|
|
|
use SWP\Bundle\CoreBundle\DependencyInjection\Compiler\OverrideThemeAssetsInstallerPass; |
28
|
|
|
use SWP\Bundle\CoreBundle\DependencyInjection\Compiler\OverrideThemeFactoryPass; |
29
|
|
|
use SWP\Bundle\CoreBundle\DependencyInjection\Compiler\OverrideThemeLoaderPass; |
30
|
|
|
use SWP\Bundle\CoreBundle\DependencyInjection\Compiler\OverrideThemePathResolverPass; |
31
|
|
|
use SWP\Bundle\CoreBundle\DependencyInjection\Compiler\OverrideThemeRepositoryPass; |
32
|
|
|
use SWP\Bundle\CoreBundle\DependencyInjection\Compiler\OverrideTwigContentCache; |
33
|
1 |
|
use SWP\Bundle\CoreBundle\DependencyInjection\Compiler\RegisterOutputChannelAdapterPass; |
34
|
|
|
use SWP\Bundle\StorageBundle\DependencyInjection\Bundle\Bundle; |
35
|
1 |
|
use SWP\Bundle\StorageBundle\Drivers; |
36
|
|
|
use SWP\Bundle\CoreBundle\Theme\Configuration\TenantableConfigurationSourceFactory; |
37
|
|
|
use Sylius\Bundle\ThemeBundle\DependencyInjection\SyliusThemeExtension; |
38
|
1 |
|
use Symfony\Component\DependencyInjection\ContainerBuilder; |
39
|
1 |
|
|
40
|
1 |
|
class SWPCoreBundle extends Bundle |
41
|
1 |
|
{ |
42
|
1 |
|
/** |
43
|
1 |
|
* {@inheritdoc} |
44
|
1 |
|
*/ |
45
|
1 |
|
public function build(ContainerBuilder $container) |
46
|
|
|
{ |
47
|
|
|
parent::build($container); |
48
|
|
|
|
49
|
|
|
/** @var SyliusThemeExtension $themeExtension */ |
50
|
1 |
|
$themeExtension = $container->getExtension('sylius_theme'); |
51
|
|
|
$themeExtension->addConfigurationSourceFactory(new TenantableConfigurationSourceFactory()); |
52
|
|
|
$container->addCompilerPass(new OverrideThemeFactoryPass()); |
53
|
1 |
|
$container->addCompilerPass(new OverrideThemePathResolverPass()); |
54
|
|
|
$container->addCompilerPass(new OverrideThemeAssetsInstallerPass()); |
55
|
|
|
$container->addCompilerPass(new OverrideDynamicRouterPass()); |
56
|
|
|
$container->addCompilerPass(new OverrideMediaManagerPass()); |
57
|
|
|
$container->addCompilerPass(new OverrideContainerProviderPass()); |
58
|
|
|
$container->addCompilerPass(new OverrideTemplatesSystemPass()); |
59
|
|
|
$container->addCompilerPass(new OverrideThemeLoaderPass()); |
60
|
1 |
|
$container->addCompilerPass(new OverrideSettingsManagerPass()); |
61
|
|
|
$container->addCompilerPass(new OverrideArticleBodyProcessorPass()); |
62
|
1 |
|
$container->addCompilerPass(new AddCustomTwigCachePass()); |
63
|
|
|
$container->addCompilerPass(new OverrideArticleSourceAdderPass()); |
64
|
|
|
$container->addCompilerPass(new OrganizationThemesProviderPass()); |
65
|
|
|
$container->addCompilerPass(new OverrideThemeRepositoryPass()); |
66
|
|
|
$container->addCompilerPass(new OverrideTwigContentCache()); |
67
|
|
|
$container->addCompilerPass(new OverridePackagePreviewTokenFactoryPass()); |
68
|
|
|
$container->addCompilerPass(new RegisterOutputChannelAdapterPass()); |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* {@inheritdoc} |
73
|
|
|
*/ |
74
|
|
|
public function getSupportedDrivers() |
75
|
|
|
{ |
76
|
|
|
return [ |
77
|
|
|
Drivers::DRIVER_DOCTRINE_ORM, |
78
|
|
|
]; |
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
/** |
82
|
|
|
* {@inheritdoc} |
83
|
|
|
*/ |
84
|
|
|
public function getModelClassNamespace() |
85
|
|
|
{ |
86
|
|
|
return 'SWP\Bundle\CoreBundle\Model'; |
87
|
|
|
} |
88
|
|
|
} |
89
|
|
|
|