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