|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/* |
|
4
|
|
|
* This file is part of the LightSAML-Core package. |
|
5
|
|
|
* |
|
6
|
|
|
* (c) Milos Tomic <[email protected]> |
|
7
|
|
|
* |
|
8
|
|
|
* This source file is subject to the MIT license that is bundled |
|
9
|
|
|
* with this source code in the file LICENSE. |
|
10
|
|
|
*/ |
|
11
|
|
|
|
|
12
|
|
|
namespace LightSaml\Bridge\Pimple\Container; |
|
13
|
|
|
|
|
14
|
|
|
use LightSaml\Build\Container\SystemContainerInterface; |
|
15
|
|
|
use LightSaml\Provider\TimeProvider\TimeProviderInterface; |
|
16
|
|
|
use Psr\Log\LoggerInterface; |
|
17
|
|
|
use Symfony\Component\EventDispatcher\EventDispatcherInterface; |
|
18
|
|
|
use Symfony\Component\HttpFoundation\Request; |
|
19
|
|
|
use Symfony\Component\HttpFoundation\Session\SessionInterface; |
|
20
|
|
|
|
|
21
|
|
|
class SystemContainer extends AbstractPimpleContainer implements SystemContainerInterface |
|
22
|
|
|
{ |
|
23
|
|
|
const REQUEST = 'lightsaml.container.request'; |
|
24
|
|
|
const SESSION = 'lightsaml.container.session'; |
|
25
|
|
|
const TIME_PROVIDER = 'lightsaml.container.time_provider'; |
|
26
|
|
|
const EVENT_DISPATCHER = 'lightsaml.container.event_dispatcher'; |
|
27
|
|
|
const LOGGER = 'lightsaml.container.logger'; |
|
28
|
|
|
|
|
29
|
|
|
/** |
|
30
|
|
|
* @return Request |
|
31
|
|
|
*/ |
|
32
|
|
|
public function getRequest() |
|
33
|
|
|
{ |
|
34
|
|
|
return $this->pimple[self::REQUEST]; |
|
35
|
|
|
} |
|
36
|
|
|
|
|
37
|
|
|
/** |
|
38
|
|
|
* @return SessionInterface |
|
39
|
|
|
*/ |
|
40
|
|
|
public function getSession() |
|
41
|
|
|
{ |
|
42
|
|
|
return $this->pimple[self::SESSION]; |
|
43
|
|
|
} |
|
44
|
|
|
|
|
45
|
|
|
/** |
|
46
|
|
|
* @return TimeProviderInterface |
|
47
|
|
|
*/ |
|
48
|
|
|
public function getTimeProvider() |
|
49
|
|
|
{ |
|
50
|
|
|
return $this->pimple[self::TIME_PROVIDER]; |
|
51
|
|
|
} |
|
52
|
|
|
|
|
53
|
|
|
/** |
|
54
|
|
|
* @return EventDispatcherInterface |
|
55
|
|
|
*/ |
|
56
|
|
|
public function getEventDispatcher() |
|
57
|
|
|
{ |
|
58
|
|
|
return $this->pimple[self::EVENT_DISPATCHER]; |
|
59
|
|
|
} |
|
60
|
|
|
|
|
61
|
|
|
/** |
|
62
|
|
|
* @return LoggerInterface |
|
63
|
|
|
*/ |
|
64
|
|
|
public function getLogger() |
|
65
|
|
|
{ |
|
66
|
|
|
return $this->pimple[self::LOGGER]; |
|
67
|
|
|
} |
|
68
|
|
|
} |
|
69
|
|
|
|