25use DebugBar\DataCollector\DataCollector;
26use DebugBar\DataCollector\Renderable;
50 protected $messages = [];
60 set_error_handler([$this,
'errorHandler'], E_ALL);
72 'count' => count($messages),
73 'messages' => $messages,
84 $messages = $this->messages;
93 static function ($itemA, $itemB) {
94 if ($itemA[
'time'] === $itemB[
'time']) {
97 return $itemA[
'time'] < $itemB[
'time'] ? -1 : 1;
116 'widget' =>
'PhpDebugBar.Widgets.MessagesWidget',
117 'map' =>
"$name.messages",
121 'map' =>
"$name.count",
149 for ($i = 0; $i < 15; $i++) {
150 if ($type = $severity & (1 << $i)) {
152 $this->messages[] = [
153 'message' => $message .
' (' . $fileName .
':' . $line .
')',
154 'message_html' =>
null,
157 'time' => microtime(
true),
176 E_WARNING =>
'WARNING',
178 E_NOTICE =>
'NOTICE',
179 E_CORE_ERROR =>
'CORE_ERROR',
180 E_CORE_WARNING =>
'CORE_WARNING',
181 E_COMPILE_ERROR =>
'COMPILE_ERROR',
182 E_COMPILE_WARNING =>
'COMPILE_WARNING',
183 E_USER_ERROR =>
'USER_ERROR',
184 E_USER_WARNING =>
'USER_WARNING',
185 E_USER_NOTICE =>
'USER_NOTICE',
186 E_STRICT =>
'STRICT',
187 E_RECOVERABLE_ERROR =>
'RECOVERABLE_ERROR',
188 E_DEPRECATED =>
'DEPRECATED',
189 E_USER_DEPRECATED =>
'USER_DEPRECATED',
193 if (isset($errors[$type])) {
194 $result = $errors[$type];
collect()
Called by the DebugBar when data needs to be collected.
getWidgets()
Returns a hash where keys are control names and their values an array of options as defined in {.
__construct($name='Error handler')
PHPCollector constructor.
getMessages()
Returns a list of messages ordered by their timestamp.
getName()
Returns the unique name of the collector.
errorHandler($severity, $message, $fileName, $line)
Exception error handler.
friendlyErrorType($type)
Return error name from error code.
$conf db name
Only used if Module[ID]Name translation string is not found.