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\OverrideHateoasTwigHelperPass; |
24
|
|
|
use SWP\Bundle\CoreBundle\DependencyInjection\Compiler\OverrideMediaManagerPass; |
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\StorageBundle\DependencyInjection\Bundle\Bundle; |
34
|
|
|
use SWP\Bundle\StorageBundle\Drivers; |
35
|
1 |
|
use SWP\Bundle\CoreBundle\Theme\Configuration\TenantableConfigurationSourceFactory; |
36
|
|
|
use Sylius\Bundle\ThemeBundle\DependencyInjection\SyliusThemeExtension; |
37
|
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder; |
38
|
1 |
|
|
39
|
1 |
|
class SWPCoreBundle extends Bundle |
40
|
1 |
|
{ |
41
|
1 |
|
/** |
42
|
1 |
|
* {@inheritdoc} |
43
|
1 |
|
*/ |
44
|
1 |
|
public function build(ContainerBuilder $container) |
45
|
1 |
|
{ |
46
|
|
|
parent::build($container); |
47
|
|
|
|
48
|
|
|
/** @var SyliusThemeExtension $themeExtension */ |
49
|
|
|
$themeExtension = $container->getExtension('sylius_theme'); |
50
|
1 |
|
$themeExtension->addConfigurationSourceFactory(new TenantableConfigurationSourceFactory()); |
51
|
|
|
$container->addCompilerPass(new OverrideThemeFactoryPass()); |
52
|
|
|
$container->addCompilerPass(new OverrideThemePathResolverPass()); |
53
|
1 |
|
$container->addCompilerPass(new OverrideThemeAssetsInstallerPass()); |
54
|
|
|
$container->addCompilerPass(new OverrideDynamicRouterPass()); |
55
|
|
|
$container->addCompilerPass(new OverrideMediaManagerPass()); |
56
|
|
|
$container->addCompilerPass(new OverrideContainerProviderPass()); |
57
|
|
|
$container->addCompilerPass(new OverrideTemplatesSystemPass()); |
58
|
|
|
$container->addCompilerPass(new OverrideThemeLoaderPass()); |
59
|
|
|
$container->addCompilerPass(new OverrideSettingsManagerPass()); |
60
|
1 |
|
$container->addCompilerPass(new OverrideArticleBodyProcessorPass()); |
61
|
|
|
$container->addCompilerPass(new AddCustomTwigCachePass()); |
62
|
1 |
|
$container->addCompilerPass(new OverrideArticleSourceAdderPass()); |
63
|
|
|
$container->addCompilerPass(new OrganizationThemesProviderPass()); |
64
|
|
|
$container->addCompilerPass(new OverrideHateoasTwigHelperPass()); |
65
|
|
|
$container->addCompilerPass(new OverrideThemeRepositoryPass()); |
66
|
|
|
$container->addCompilerPass(new OverrideTwigContentCache()); |
67
|
|
|
} |
68
|
|
|
|
69
|
|
|
/** |
70
|
|
|
* {@inheritdoc} |
71
|
|
|
*/ |
72
|
|
|
public function getSupportedDrivers() |
73
|
|
|
{ |
74
|
|
|
return [ |
75
|
|
|
Drivers::DRIVER_DOCTRINE_ORM, |
76
|
|
|
]; |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* {@inheritdoc} |
81
|
|
|
*/ |
82
|
|
|
public function getModelClassNamespace() |
83
|
|
|
{ |
84
|
|
|
return 'SWP\Bundle\CoreBundle\Model'; |
85
|
|
|
} |
86
|
|
|
} |
87
|
|
|
|