1 | <?php |
||
15 | class Kernel |
||
16 | { |
||
17 | public const VERSION = '2.0'; |
||
18 | |||
19 | private $container; |
||
20 | |||
21 | /** @var Channel */ |
||
22 | private $channel; |
||
23 | |||
24 | /** @var Driver */ |
||
25 | private $driver; |
||
26 | |||
27 | private $session; |
||
28 | private $context; |
||
29 | |||
30 | 2 | public function __construct(Container $container) |
|
34 | |||
35 | /** |
||
36 | * Initialize kernel. |
||
37 | * |
||
38 | * @param Channel $channel |
||
39 | */ |
||
40 | public function initialize(Channel $channel): void |
||
49 | |||
50 | /** |
||
51 | * Perform shutdown tasks. |
||
52 | */ |
||
53 | public function terminate(): void |
||
65 | |||
66 | /** |
||
67 | * Get current channel. |
||
68 | * |
||
69 | * @return Channel|null |
||
70 | */ |
||
71 | public function getChannel(): ?Channel |
||
75 | |||
76 | /** |
||
77 | * Get current driver. |
||
78 | * |
||
79 | * @return Driver|null |
||
80 | */ |
||
81 | public function getDriver(): ?Driver |
||
85 | |||
86 | /** |
||
87 | * Get session. |
||
88 | * |
||
89 | * @return Session|null |
||
90 | */ |
||
91 | 1 | public function getSession(): ?Session |
|
95 | |||
96 | /** |
||
97 | * Set session. |
||
98 | * |
||
99 | * @param Session $session |
||
100 | */ |
||
101 | 1 | public function setSession(Session $session): void |
|
105 | |||
106 | /** |
||
107 | * Close session. |
||
108 | */ |
||
109 | 1 | public function closeSession(): void |
|
116 | |||
117 | /** |
||
118 | * Get context. |
||
119 | * |
||
120 | * @return Context|null |
||
121 | */ |
||
122 | 1 | public function getContext(): ?Context |
|
126 | |||
127 | /** |
||
128 | * Set context. |
||
129 | * |
||
130 | * @param Context $context |
||
131 | */ |
||
132 | 1 | public function setContext(Context $context): void |
|
136 | |||
137 | /** |
||
138 | * Clear context. |
||
139 | */ |
||
140 | 1 | public function clearContext(): void |
|
147 | |||
148 | /** |
||
149 | * Get session manager. |
||
150 | * |
||
151 | * @return SessionManager |
||
152 | */ |
||
153 | 1 | private function sessionManager(): SessionManager |
|
157 | |||
158 | /** |
||
159 | * Get context manager. |
||
160 | * |
||
161 | * @return ContextManager |
||
162 | */ |
||
163 | 1 | private function contextManager(): ContextManager |
|
167 | } |
||
168 |