1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Obblm\Core\Tests; |
4
|
|
|
|
5
|
|
|
use Doctrine\Bundle\DoctrineBundle\DoctrineBundle; |
6
|
|
|
use Obblm\Core\ObblmCoreBundle; |
7
|
|
|
use Symfony\Bundle\FrameworkBundle\FrameworkBundle; |
8
|
|
|
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; |
9
|
|
|
use Symfony\Bundle\SecurityBundle\SecurityBundle; |
10
|
|
|
use Symfony\Bundle\TwigBundle\TwigBundle; |
11
|
|
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; |
12
|
|
|
use Symfony\Component\HttpKernel\Kernel as BaseKernel; |
13
|
|
|
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator; |
14
|
|
|
|
15
|
|
|
class Kernel extends BaseKernel |
16
|
|
|
{ |
17
|
|
|
use MicroKernelTrait; |
18
|
|
|
|
19
|
|
|
protected function configureContainer(ContainerConfigurator $container): void |
20
|
|
|
{ |
21
|
|
|
$container->import('config/{packages}/*.yaml'); |
22
|
|
|
$container->import('config/{packages}/'.$this->environment.'/*.yaml'); |
23
|
|
|
|
24
|
|
|
if (is_file(\dirname(__DIR__).'/config/services.yaml')) { |
25
|
|
|
$container->import('config/services.yaml'); |
26
|
|
|
$container->import('config/{services}_'.$this->environment.'.yaml'); |
27
|
|
|
} elseif (is_file($path = \dirname(__DIR__).'/../config/services.php')) { |
28
|
|
|
(require $path)($container->withPath($path), $this); |
29
|
|
|
} |
30
|
|
|
} |
31
|
|
|
|
32
|
|
|
public function registerBundles() |
33
|
|
|
{ |
34
|
|
|
return [ |
35
|
|
|
new FrameworkBundle(), |
36
|
|
|
new TwigBundle(), |
37
|
|
|
new DoctrineBundle(), |
38
|
|
|
new SecurityBundle(), |
39
|
|
|
new ObblmCoreBundle(), |
40
|
|
|
]; |
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
protected function configureRoutes(RoutingConfigurator $routes): void |
44
|
|
|
{ |
45
|
|
|
$routes->import('config/{routes}/'.$this->environment.'/*.yaml'); |
46
|
|
|
$routes->import('config/{routes}/*.yaml'); |
47
|
|
|
|
48
|
|
|
if (is_file(\dirname(__DIR__).'/../config/routes.yaml')) { |
49
|
|
|
$routes->import('config/routes.yaml'); |
50
|
|
|
} elseif (is_file($path = \dirname(__DIR__).'/../config/routes.php')) { |
51
|
|
|
(require $path)($routes->withPath($path), $this); |
52
|
|
|
} |
53
|
|
|
} |
54
|
|
|
} |
55
|
|
|
|