public static synthesize_config( array $fragments )
$fragments
public static is_dev( void )
public static is_stage( void )
public static is_production( void )
public static configure( array $config )
$config
Configures the class.
$app->configs['debug']
public static shutdown_handler( void )
Stores logged messages in the session and report fatal errors.
public static error_handler( integer $no, string $str, string $file, integer $line, array $context )
$no
$str
$file
$line
$context
Handles errors.
The ICanBoogie\Debug::$last_error and ICanBoogie\Debug::$last_error_message properties are updated.
ICanBoogie\Debug::$last_error
ICanBoogie\Debug::$last_error_message
The alert is formatted, reported and if the verbose option is true the alert is displayed.
verbose
public static exception_handler( Exception $exception )
$exception
Basic exception handler.
public static format_alert( Exception|array $alert ) : string
$alert
Formats an alert into a HTML element.
An alert can be an exception or an array representing an error triggered with the trigger_error() function.
public static format_trace( array $trace ) : string
$trace
Formats a stack trace into an HTML element.
public static format_code_sample( string $file, integer $line = 0 ) : string
Extracts and formats a code sample around the line that triggered the alert.
public static report( string $message )
$message
Reports the alert to the admin of the website.
The method sends an email to the admin of the website defined whose email address is defined in the debug config using the "report_address" key.
public static get_messages( $level ) : string[]
$level
The method is forwarded to the core's logger get_messages() method.
get_messages()
public static fetch_messages( $level ) : string[]
The method is forwarded to the core's logger fetch_messages() method.
fetch_messages()
MODE_DEV : string
'dev'
MODE_STAGE : string
'stage'
MODE_PRODUCTION : string
'production'
MAX_STRING_LEN : integer
16
public static $mode : string
public static $last_error : array[string]mixed
Last error.
public static $last_error_message : string
Last error message.