ICanBoogie
  • Documentation
  • API Reference
  • ICanBoogie 4.0.x
Namespaces
  • ICanBoogie
    • Application
    • Autoconfig
    • Binding
    • Routing
    • Session
Classes
  • AlreadyAuthenticated
  • AppConfig
  • Core
  • Debug
  • Helpers
  • Hooks
  • Logger
  • LogLevel
  • SessionWithEvent
Interfaces
  • LoggerInterface
Traits
  • AppAccessor
  • LoggerTrait
Exceptions
  • ApplicationAlreadyBooted
  • ApplicationAlreadyInstantiated
  • ApplicationAlreadyRunning
  • ApplicationNotInstantiated

Class Debug

Namespace: ICanBoogie
Codecoverageignore
Located at Debug.php

Methods summary

public static synthesize_config( array $fragments )
public static is_dev( void )
public static is_stage( void )
public static is_production( void )
public static configure( array $config )

Configures the class.

Configures the class.

Parameters

$config
A config such as one returned by $app->configs['debug'].
public static shutdown_handler( void )

Stores logged messages in the session and report fatal errors.

Stores logged messages in the session and report fatal errors.

public static error_handler( integer $no, string $str, string $file, integer $line, array $context )

Handles errors.

Handles errors.

The ICanBoogie\Debug::$last_error and ICanBoogie\Debug::$last_error_message properties are updated.

The alert is formatted, reported and if the verbose option is true the alert is displayed.

Parameters

$no
The level of the error raised.
$str
The error message.
$file
The filename that the error was raised in.
$line
The line number the error was raised at.
$context
The active symbol table at the point the error occurred.
public static exception_handler( Error|Exception $exception )

Basic exception handler.

Basic exception handler.

Parameters

$exception
public static format_alert( Exception|array $alert ) : string

Formats an alert into a HTML element.

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.

Parameters

$alert

Returns

string
public static format_trace( array $trace ) : string

Formats a stack trace into an HTML element.

Formats a stack trace into an HTML element.

Parameters

$trace

Returns

string
public static format_code_sample( string $file, integer $line = 0 ) : string

Extracts and formats a code sample around the line that triggered the alert.

Extracts and formats a code sample around the line that triggered the alert.

Parameters

$file
$line

Returns

string
public static report( string $message )

Reports the alert to the admin of the website.

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.

Parameters

$message
public static get_messages( $level ) : string[]

The method is forwarded to the application's logger get_messages() method.

The method is forwarded to the application's logger get_messages() method.

Parameters

$level

Returns

string[]
public static fetch_messages( $level ) : string[]

The method is forwarded to the application's logger fetch_messages() method.

The method is forwarded to the application's logger fetch_messages() method.

Parameters

$level

Returns

string[]

Constants summary

MODE_DEV : string
'dev'
MODE_STAGE : string
'stage'
MODE_PRODUCTION : string
'production'
MAX_STRING_LEN : integer
16

Properties summary

public static $mode : string
'dev'
public static $last_error : array[string]mixed

Last error.

Last error.


		
public static $last_error_message : string

Last error message.

Last error message.


		
ICanBoogie 4.0.x – Check on GitHub – API documentation generated by ApiGen