1 | <?php |
||
50 | class Kernel |
||
51 | { |
||
52 | /** |
||
53 | * Kernel instance |
||
54 | * |
||
55 | * @var \Apparat\Kernel\Domain\Model\Kernel |
||
56 | */ |
||
57 | protected static $kernel = null; |
||
58 | |||
59 | /** |
||
60 | * Register an apparat module |
||
61 | * |
||
62 | * @param ModuleInterface $module Apparat module |
||
63 | */ |
||
64 | 2 | public static function register(ModuleInterface $module) |
|
68 | |||
69 | /** |
||
70 | * Create an object instance |
||
71 | * |
||
72 | * @param string $name Object class name |
||
73 | * @param array $args Object constructor arguments |
||
74 | * @return object Object instance |
||
75 | */ |
||
76 | 1 | public static function create($name, array $args = []) |
|
80 | |||
81 | /** |
||
82 | * System is unusable |
||
83 | * |
||
84 | * @param string $message |
||
85 | * @param array $context |
||
86 | * @return null |
||
87 | */ |
||
88 | 1 | public static function emergency($message, array $context = array()) |
|
92 | |||
93 | /** |
||
94 | * Action must be taken immediately |
||
95 | * |
||
96 | * Example: Entire website down, database unavailable, etc. This should |
||
97 | * trigger the SMS alerts and wake you up. |
||
98 | * |
||
99 | * @param string $message |
||
100 | * @param array $context |
||
101 | * @return null |
||
102 | */ |
||
103 | 1 | public static function alert($message, array $context = array()) |
|
107 | |||
108 | /** |
||
109 | * Critical conditions |
||
110 | * |
||
111 | * Example: Application component unavailable, unexpected exception. |
||
112 | * |
||
113 | * @param string $message |
||
114 | * @param array $context |
||
115 | * @return null |
||
116 | */ |
||
117 | 1 | public static function critical($message, array $context = array()) |
|
121 | |||
122 | /** |
||
123 | * Runtime errors that do not require immediate action but should typically |
||
124 | * be logged and monitored |
||
125 | * |
||
126 | * @param string $message |
||
127 | * @param array $context |
||
128 | * @return null |
||
129 | */ |
||
130 | 1 | public static function error($message, array $context = array()) |
|
134 | |||
135 | /** |
||
136 | * Exceptional occurrences that are not errors |
||
137 | * |
||
138 | * Example: Use of deprecated APIs, poor use of an API, undesirable things |
||
139 | * that are not necessarily wrong. |
||
140 | * |
||
141 | * @param string $message |
||
142 | * @param array $context |
||
143 | * @return null |
||
144 | */ |
||
145 | 1 | public static function warning($message, array $context = array()) |
|
149 | |||
150 | /** |
||
151 | * Normal but significant events |
||
152 | * |
||
153 | * @param string $message |
||
154 | * @param array $context |
||
155 | * @return null |
||
156 | */ |
||
157 | 1 | public static function notice($message, array $context = array()) |
|
161 | |||
162 | /** |
||
163 | * Interesting events |
||
164 | * |
||
165 | * Example: User logs in, SQL logs. |
||
166 | * |
||
167 | * @param string $message |
||
168 | * @param array $context |
||
169 | * @return null |
||
170 | */ |
||
171 | 1 | public static function info($message, array $context = array()) |
|
175 | |||
176 | /** |
||
177 | * Detailed debug information |
||
178 | * |
||
179 | * @param string $message |
||
180 | * @param array $context |
||
181 | * @return null |
||
182 | */ |
||
183 | 1 | public static function debug($message, array $context = array()) |
|
187 | |||
188 | /** |
||
189 | * Logs with an arbitrary level |
||
190 | * |
||
191 | * @param mixed $level |
||
192 | * @param string $message |
||
193 | * @param array $context |
||
194 | * @return null |
||
195 | */ |
||
196 | 1 | public static function log($level, $message, array $context = array()) |
|
200 | |||
201 | /** |
||
202 | * Create and return the kernel instance |
||
203 | * |
||
204 | * @return \Apparat\Kernel\Domain\Model\Kernel Kernel instance |
||
205 | */ |
||
206 | 2 | protected static function getKernel() |
|
214 | } |
||
215 |