-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAppKernel.php
82 lines (75 loc) · 2.68 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
77
78
79
80
81
82
<?php
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Routing\RouteCollectionBuilder;
use Vanio\UserBundle\Tests\Fixtures\DummyUserManager;
class AppKernel extends Kernel
{
use MicroKernelTrait;
/**
* @return Bundle[]
*/
public function registerBundles(): array
{
return [
new Symfony\Bundle\FrameworkBundle\FrameworkBundle,
new Symfony\Bundle\SecurityBundle\SecurityBundle,
new Symfony\Bundle\TwigBundle\TwigBundle,
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle,
new FOS\UserBundle\FOSUserBundle,
new HWI\Bundle\OAuthBundle\HWIOAuthBundle,
new Vanio\WebBundle\VanioWebBundle,
new Vanio\UserBundle\VanioUserBundle,
];
}
public function getRootDir(): string
{
return __DIR__;
}
public function getCacheDir(): string
{
return sprintf('%s/var/cache/%s', __DIR__, $this->getEnvironment());
}
public function getLogDir(): string
{
return __DIR__ . '/var/logs';
}
protected function configureRoutes(RouteCollectionBuilder $routes): void
{}
protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void
{
$container->setDefinition('dummy_user_manager', new Definition(DummyUserManager::class));
$container->loadFromExtension('framework', [
'secret' => 'secret',
'form' => null,
'session' => null,
'templating' => ['engines' => 'twig'],
]);
$container->loadFromExtension('security', [
'firewalls' => [
'main' => [
'oauth' => [
'login_path' => 'login_path',
'oauth_user_provider' => ['oauth' => null],
'resource_owners' => null,
],
],
],
]);
$container->loadFromExtension('fos_user', [
'from_email' => [
'address' => '[email protected]',
'sender_name' => 'webmaster',
],
'db_driver' => 'custom',
'user_class' => 'user_class',
'service' => ['user_manager' => 'dummy_user_manager'],
'use_flash_notifications' => false,
]);
$container->loadFromExtension('hwi_oauth', ['resource_owners' => null]);
}
}