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 |
||
45 | |||
46 | /** |
||
47 | * Perform shutdown tasks. |
||
48 | */ |
||
49 | public function terminate(): void |
||
61 | |||
62 | /** |
||
63 | * Get current channel. |
||
64 | * |
||
65 | * @return Channel|null |
||
66 | */ |
||
67 | public function getChannel(): ?Channel |
||
71 | |||
72 | /** |
||
73 | * Get current driver. |
||
74 | * |
||
75 | * @return Driver|null |
||
76 | */ |
||
77 | public function getDriver(): ?Driver |
||
81 | |||
82 | /** |
||
83 | * Get session. |
||
84 | * |
||
85 | * @return Session|null |
||
86 | */ |
||
87 | 1 | public function getSession(): ?Session |
|
91 | |||
92 | /** |
||
93 | * Set session. |
||
94 | * |
||
95 | * @param Session $session |
||
96 | */ |
||
97 | 1 | public function setSession(Session $session): void |
|
101 | |||
102 | /** |
||
103 | * Close session. |
||
104 | */ |
||
105 | 1 | public function closeSession(): void |
|
112 | |||
113 | /** |
||
114 | * Get context. |
||
115 | * |
||
116 | * @return Context|null |
||
117 | */ |
||
118 | 1 | public function getContext(): ?Context |
|
122 | |||
123 | /** |
||
124 | * Set context. |
||
125 | * |
||
126 | * @param Context $context |
||
127 | */ |
||
128 | 1 | public function setContext(Context $context): void |
|
132 | |||
133 | /** |
||
134 | * Clear context. |
||
135 | */ |
||
136 | 1 | public function clearContext(): void |
|
143 | |||
144 | /** |
||
145 | * Get session manager. |
||
146 | * |
||
147 | * @return SessionManager |
||
148 | */ |
||
149 | 1 | private function sessionManager(): SessionManager |
|
153 | |||
154 | /** |
||
155 | * Get context manager. |
||
156 | * |
||
157 | * @return ContextManager |
||
158 | */ |
||
159 | 1 | private function contextManager(): ContextManager |
|
163 | } |
||
164 |