-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdependencies.php
40 lines (31 loc) · 942 Bytes
/
dependencies.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
<?php
use \Slim\Views\Twig;
use \SlimSession\Helper;
use \Adldap\Adldap;
use \Slim\Flash\Messages;
$container = $app->getContainer();
$container['entityManager'] = function($container)
{
global $entityManager;
return $entityManager;
};
$container['flashMessages'] = function ($container) {
return new Messages();
};
$container['twig'] = function($container)
{
$twigSettings = $container->get('settings')['twig'];
$view = new Twig($twigSettings['templates-folder'], array('cache' => $twigSettings['cache'], 'debug' => $twigSettings['debug']));
$view->getEnvironment()->addGlobal('flash', $container['flashMessages']);
return $view;
};
$container['ldap'] = function ($container) {
return new Adldap();
};
$container['session'] = function($container)
{
return new Helper();
};
$container['ldapService'] = function ($container) {
return new services\LoginService($container, $container['settings']['ldapConfig']);
};