dolibarr 19.0.4
PhpCollector Class Reference

Class PhpCollector. More...

Inheritance diagram for PhpCollector:
Collaboration diagram for PhpCollector:

Public Member Functions

 __construct ($name='Error handler')
 PHPCollector constructor.
 
 collect ()
 Called by the DebugBar when data needs to be collected.
 
 getMessages ()
 Returns a list of messages ordered by their timestamp.
 
 getWidgets ()
 Returns a hash where keys are control names and their values an array of options as defined in {.
 
 getName ()
 Returns the unique name of the collector.
 
 errorHandler ($severity, $message, $fileName, $line)
 Exception error handler.
 

Private Member Functions

 friendlyErrorType ($type)
 Return error name from error code.
 

Detailed Description

Class PhpCollector.

This class collects all PHP errors, notice, advices, trigger_error,... Supports 15 different types included.

Definition at line 33 of file DolPhpCollector.php.

Constructor & Destructor Documentation

◆ __construct()

PhpCollector::__construct ( $name = 'Error handler')

PHPCollector constructor.

Parameters
string$nameThe name used by this collector widget.

Definition at line 55 of file DolPhpCollector.php.

References name.

Member Function Documentation

◆ collect()

PhpCollector::collect ( )

Called by the DebugBar when data needs to be collected.

Returns
array Collected data.

Definition at line 66 of file DolPhpCollector.php.

References getMessages().

◆ errorHandler()

PhpCollector::errorHandler ( $severity,
$message,
$fileName,
$line )

Exception error handler.

Called from constructor with set_error_handler to add all details.

Parameters
int$severityError type.
string$messageMessage of error.
string$fileNameFile where error is generated.
int$lineLine number where error is generated.
Returns
void

Definition at line 137 of file DolPhpCollector.php.

References friendlyErrorType().

◆ friendlyErrorType()

PhpCollector::friendlyErrorType ( $type)
private

Return error name from error code.

@info http://php.net/manual/es/errorfunc.constants.php

Parameters
int$typeError code.
Returns
string Error name.

Definition at line 162 of file DolPhpCollector.php.

Referenced by errorHandler().

◆ getMessages()

PhpCollector::getMessages ( )

Returns a list of messages ordered by their timestamp.

Returns
array A list of messages ordered by time.

Definition at line 80 of file DolPhpCollector.php.

Referenced by collect().

◆ getName()

PhpCollector::getName ( )

Returns the unique name of the collector.

Returns
string The widget name.

Definition at line 122 of file DolPhpCollector.php.

Referenced by getWidgets().

◆ getWidgets()

PhpCollector::getWidgets ( )

Returns a hash where keys are control names and their values an array of options as defined in {.

See also
DebugBar\JavascriptRendereraddControl()}
Returns
array Needed details to render the widget.

Definition at line 100 of file DolPhpCollector.php.

References getName().


The documentation for this class was generated from the following file: