forked from nevercodealone/cms-symfony-sulu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathKernel.php
51 lines (42 loc) · 1.49 KB
/
Kernel.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
<?php
namespace App;
/*
* This file is part of Sulu.
*
* (c) MASSIVE ART WebServices GmbH
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
use FOS\HttpCache\SymfonyCache\HttpCacheProvider;
use Sulu\Bundle\HttpCacheBundle\Cache\SuluHttpCache;
use Sulu\Component\HttpKernel\SuluKernel;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\HttpKernelInterface;
class Kernel extends SuluKernel implements HttpCacheProvider
{
/**
* @var HttpKernelInterface
*/
private $httpCache;
public function __construct(string $environment, bool $debug, string $suluContext = self::CONTEXT_ADMIN)
{
parent::__construct($environment, $debug, $suluContext);
}
protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)
{
// Feel free to remove the "container.autowiring.strict_mode" parameter
// if you are using symfony/dependency-injection 4.0+ as it's the default behavior
$container->setParameter('container.autowiring.strict_mode', true);
$container->setParameter('container.dumper.inline_class_loader', true);
parent::configureContainer($container, $loader);
}
public function getHttpCache()
{
if (!$this->httpCache) {
$this->httpCache = new SuluHttpCache($this);
}
return $this->httpCache;
}
}