DebugLib
in package
DebugLib Class
Table of Contents
- $logs : array<string|int, mixed>
- Contains an array of errors
- $queries : array<string|int, mixed>
- Contains an array of executed queries
- add() : void
- Add a query to the query list
- echoLog() : string
- Returns the database log information
- error() : void
- Take different actions like displaying the error, logging the error and sending an email
- log() : void
- Save errors
- dump() : string
- dump
- whereCalled() : string
- Return error stack trace until provided level
- writeErrors() : void
- Log the errors into a file
Properties
$logs
Contains an array of errors
private
array<string|int, mixed>
$logs
= []
$queries
Contains an array of executed queries
private
array<string|int, mixed>
$queries
= []
Methods
add()
Add a query to the query list
public
add(int $query) : void
Parameters
- $query : int
-
Query
Return values
void —echoLog()
Returns the database log information
public
echoLog() : string
Return values
string —error()
Take different actions like displaying the error, logging the error and sending an email
public
error(int $code[, string $description = '' ][, string $file = '' ], int $line[, string $type = 'db' ]) : void
Parameters
- $code : int
- $description : string = ''
- $file : string = ''
- $line : int
- $type : string = 'db'
Return values
void —log()
Save errors
public
log(int $code, string $description[, string $file = '' ], int $line[, string $type = 'db' ]) : void
Parameters
- $code : int
- $description : string
- $file : string = ''
- $line : int
- $type : string = 'db'
Return values
void —dump()
dump
private
dump(array<string|int, mixed> $var) : string
Parameters
- $var : array<string|int, mixed>
-
Var
Return values
string —whereCalled()
Return error stack trace until provided level
private
whereCalled([int $level = 5 ]) : string
Parameters
- $level : int = 5
Return values
string —writeErrors()
Log the errors into a file
private
writeErrors(string $text, string $type) : void
Parameters
- $text : string
- $type : string