25use DebugBar\DataCollector\DataCollector;
26use DebugBar\DataCollector\Renderable;
49 protected $messages = [];
59 set_error_handler([$this,
'errorHandler'], E_ALL);
71 'count' => count($messages),
72 'messages' => $messages,
83 $messages = $this->messages;
92 static function ($itemA, $itemB) {
93 if ($itemA[
'time'] === $itemB[
'time']) {
96 return $itemA[
'time'] < $itemB[
'time'] ? -1 : 1;
115 'widget' =>
'PhpDebugBar.Widgets.MessagesWidget',
116 'map' =>
"$name.messages",
120 'map' =>
"$name.count",
148 for ($i = 0; $i < 15; $i++) {
149 if ($type = $severity & (1 << $i)) {
151 $this->messages[] = [
152 'message' => $message .
' (' . $fileName .
':' . $line .
')',
153 'message_html' =>
null,
156 'time' => microtime(
true),
175 E_WARNING =>
'WARNING',
177 E_NOTICE =>
'NOTICE',
178 E_CORE_ERROR =>
'CORE_ERROR',
179 E_CORE_WARNING =>
'CORE_WARNING',
180 E_COMPILE_ERROR =>
'COMPILE_ERROR',
181 E_COMPILE_WARNING =>
'COMPILE_WARNING',
182 E_USER_ERROR =>
'USER_ERROR',
183 E_USER_WARNING =>
'USER_WARNING',
184 E_USER_NOTICE =>
'USER_NOTICE',
185 E_STRICT =>
'STRICT',
186 E_RECOVERABLE_ERROR =>
'RECOVERABLE_ERROR',
187 E_DEPRECATED =>
'DEPRECATED',
188 E_USER_DEPRECATED =>
'USER_DEPRECATED',
192 if (isset($errors[$type])) {
193 $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.