-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAppKernel.php
76 lines (64 loc) · 1.76 KB
/
AppKernel.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
74
75
76
<?php
declare(strict_types=1);
/*
* This file is part of the xezilaires project.
*
* (c) sigwin.hr
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Xezilaires\Bridge\Symfony;
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\BundleInterface;
use Symfony\Component\HttpKernel\Kernel;
use Xezilaires\Bridge\Symfony\DependencyInjection\CompilerPass\RegisterCommandsCompilerPass;
/**
* @internal
*/
final class AppKernel extends Kernel
{
/**
* @var BundleInterface[]
*/
private array $customBundles;
/**
* @param BundleInterface[] $customBundles
*/
public function __construct(array $customBundles)
{
parent::__construct('prod', false);
$this->customBundles = $customBundles;
}
/**
* @return BundleInterface[]
*/
public function registerBundles(): array
{
return array_merge([
new FrameworkBundle(),
new XezilairesBundle(),
], $this->customBundles);
}
/**
* @throws \Exception
*/
public function registerContainerConfiguration(LoaderInterface $loader): void
{
$loader->load(__DIR__.'/Resources/bin-config/services.xml');
}
public function getCacheDir(): string
{
return '/dev/shm/'.sha1(__DIR__.time()).'/logs';
}
public function getLogDir(): string
{
return '/dev/shm/'.sha1(__DIR__.time()).'/logs';
}
protected function build(ContainerBuilder $container): void
{
$container->addCompilerPass(new RegisterCommandsCompilerPass());
}
}