24use DebugBar\DataCollector\DataCollector;
25use DebugBar\DataCollector\Renderable;
48 protected $messages = [];
58 set_error_handler([$this,
'errorHandler'], E_ALL);
70 'count' => count($messages),
71 'messages' => $messages,
82 $messages = $this->messages;
84 usort($messages,
function ($itemA, $itemB) {
85 if ($itemA[
'time'] === $itemB[
'time']) {
88 return $itemA[
'time'] < $itemB[
'time'] ? -1 : 1;
106 'widget' =>
'PhpDebugBar.Widgets.MessagesWidget',
107 'map' =>
"$name.messages",
111 'map' =>
"$name.count",
139 for ($i = 0; $i < 15; $i++) {
140 if ($type = $severity & (2 ** $i)) {
142 $this->messages[] = [
143 'message' => $message .
' (' . $fileName .
':' . $line .
')',
144 'message_html' =>
null,
147 'time' => microtime(
true),
166 E_WARNING =>
'WARNING',
168 E_NOTICE =>
'NOTICE',
169 E_CORE_ERROR =>
'CORE_ERROR',
170 E_CORE_WARNING =>
'CORE_WARNING',
171 E_COMPILE_ERROR =>
'COMPILE_ERROR',
172 E_COMPILE_WARNING =>
'COMPILE_WARNING',
173 E_USER_ERROR =>
'USER_ERROR',
174 E_USER_WARNING =>
'USER_WARNING',
175 E_USER_NOTICE =>
'USER_NOTICE',
176 E_STRICT =>
'STRICT',
177 E_RECOVERABLE_ERROR =>
'RECOVERABLE_ERROR',
178 E_DEPRECATED =>
'DEPRECATED',
179 E_USER_DEPRECATED =>
'USER_DEPRECATED',
183 if (isset($errors[$type])) {
184 $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.