-
-
Notifications
You must be signed in to change notification settings - Fork 111
Expand file tree
/
Copy pathAppKernel.php
More file actions
104 lines (89 loc) · 3.16 KB
/
AppKernel.php
File metadata and controls
104 lines (89 loc) · 3.16 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<?php
declare(strict_types=1);
/*
* This file is part of the Sonata Project package.
*
* (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sonata\ClassificationBundle\Tests\App;
use DAMA\DoctrineTestBundle\DAMADoctrineTestBundle;
use Doctrine\Bundle\DoctrineBundle\DoctrineBundle;
use Knp\Bundle\MenuBundle\KnpMenuBundle;
use Sonata\AdminBundle\SonataAdminBundle;
use Sonata\BlockBundle\Cache\HttpCacheHandler;
use Sonata\BlockBundle\SonataBlockBundle;
use Sonata\ClassificationBundle\SonataClassificationBundle;
use Sonata\Doctrine\Bridge\Symfony\SonataDoctrineBundle;
use Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle;
use Sonata\Form\Bridge\Symfony\SonataFormBundle;
use Sonata\Twig\Bridge\Symfony\SonataTwigBundle;
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
use Symfony\Bundle\SecurityBundle\SecurityBundle;
use Symfony\Bundle\TwigBundle\TwigBundle;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\UX\StimulusBundle\StimulusBundle;
final class AppKernel extends Kernel
{
use MicroKernelTrait;
public function registerBundles(): iterable
{
return [
new DoctrineBundle(),
new DAMADoctrineTestBundle(),
new FrameworkBundle(),
new KnpMenuBundle(),
new SecurityBundle(),
new SonataTwigBundle(),
new SonataFormBundle(),
new SonataAdminBundle(),
new SonataBlockBundle(),
new SonataDoctrineBundle(),
new SonataDoctrineORMAdminBundle(),
new SonataClassificationBundle(),
new TwigBundle(),
new StimulusBundle(),
];
}
public function getCacheDir(): string
{
return $this->getBaseDir().'cache';
}
public function getLogDir(): string
{
return $this->getBaseDir().'log';
}
public function getProjectDir(): string
{
return __DIR__;
}
protected function configureRoutes(RoutingConfigurator $routes): void
{
$routes->import(__DIR__.'/config/routes.yaml');
}
protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void
{
$loader->load(__DIR__.'/config/config.yaml');
if (!class_exists(IsGranted::class)) {
$loader->load(__DIR__.'/config/config_symfony_v5.yaml');
}
/*
* TODO: Remove when dropping support SonataBlock v4
*/
if (class_exists(HttpCacheHandler::class)) {
$loader->load(__DIR__.'/config/config_sonata_block_v4.yaml');
}
$container->setParameter('app.base_dir', $this->getBaseDir());
}
private function getBaseDir(): string
{
return sys_get_temp_dir().'/sonata-classification-bundle/var/';
}
}