forked from coreshop/ThemeBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CoreShopThemeBundle.php
73 lines (63 loc) · 1.92 KB
/
CoreShopThemeBundle.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?php
/**
* CoreShop.
*
* This source file is subject to the GNU General Public License version 3 (GPLv3)
* For the full copyright and license information, please view the LICENSE.md and gpl-3.0.txt
* files that are distributed with this source code.
*
* @copyright Copyright (c) 2015-2019 Dominik Pfaffenbauer (https://www.pfaffenbauer.at)
* @license https://www.coreshop.org/license GNU General Public License version 3 (GPLv3)
*/
namespace CoreShop\Bundle\ThemeBundle;
use CoreShop\Bundle\ThemeBundle\DependencyInjection\Compiler\CompositeThemeResolverPass;
use Liip\ThemeBundle\LiipThemeBundle;
use PackageVersions\Versions;
use Pimcore\Extension\Bundle\AbstractPimcoreBundle;
use Pimcore\Extension\Bundle\Traits\PackageVersionTrait;
use Pimcore\HttpKernel\Bundle\DependentBundleInterface;
use Pimcore\HttpKernel\BundleCollection\BundleCollection;
use Symfony\Component\DependencyInjection\ContainerBuilder;
class CoreShopThemeBundle extends AbstractPimcoreBundle implements DependentBundleInterface
{
use PackageVersionTrait;
/**
* {@inheritdoc}
*/
public static function registerDependentBundles(BundleCollection $collection)
{
$collection->addBundle(new LiipThemeBundle(), 1100);
}
/**
* {@inheritdoc}
*/
public function build(ContainerBuilder $container)
{
parent::build($container);
$container->addCompilerPass(new CompositeThemeResolverPass());
}
/**
* {@inheritdoc}
*/
public function getNiceName()
{
return 'CoreShop - Theme';
}
/**
* {@inheritdoc}
*/
public function getDescription()
{
return 'CoreShop - Theme Bundle';
}
/**
* @return string
*/
public function getComposerPackageName()
{
if (isset(Versions::VERSIONS['coreshop/theme-bundle'])) {
return 'coreshop/theme-bundle';
}
return 'coreshop/core-shop';
}
}