Magrathea PHP 2

Debugger extends Singleton
in package

Magrathea Debugger can manage anything for debugging and error-searching through Magrathea Codes.

It can trace errors, save log files, print queries and do a bunch of functions that would help the developer on error searching

Table of Contents

Constants

DEBUG  = 3
DEV  = 4
LOG  = 2
NONE  = 0

Properties

$instance  : array<string|int, mixed>|null
$debugItems  : mixed
$debugType  : mixed
$logFile  : mixed
$oldDebugType  : mixed
$queries  : mixed

Methods

__wakeup()  : mixed
Add()  : mixed
Add an item to the debug array object
AddError()  : mixed
Adds an error to the debugger
AddQuery()  : mixed
Adds a query to the debug
BackTemp()  : Debugger
After temporarily setting a debugging type, gets it back to what it was
Error()  : mixed
Adds an error to the debugger
GetType()  : string
Returns the debug type
GetTypeDesc()  : string
Returns the debug type in a descritive format
Info()  : mixed
Add an info item to the debug array object
Instance()  : static|Singleton
LogQueries()  : Debugger
Should debugger log queries?
MockClass()  : static|Singleton
SetDebug()  : Debugger
Sets debug mode as debug
SetDev()  : Debugger
Sets debug mode as dev
SetInstance()  : mixed
SetLogFile()  : Debugger
Set the name of log file that will be used (it will be created inside "*logs*" folder)
SetTemp()  : Debugger
Sets a debugger type temporarily (usefull when need to check a specific operation, for example)
SetType()  : Debugger
Sets the debugger method It can be: *DEV*, *DEBUG*, *LOG*, *NONE* => **Debugger::DEV** = Will print the debugs as it appears in the code **Debugger::DEBUG** = Will store all the debugs and print it later **Debugger::LOG** = Will log queries and other debugs in the code **Debugger::NONE** = Well... nothing to do, heh? Default: **LOG**
Show()  : mixed
Prints the debug
Trace()  : mixed
Trace error location
__clone()  : mixed
__construct()  : mixed
printsDebug()  : mixed
prints every single line in p_r()
printTrace()  : string
gets a trace array and returns a beautiful way of it printed

Constants

Properties

$instance

protected static array<string|int, mixed>|null $instance = []

$debugItems

private mixed $debugItems = array()

$debugType

private mixed $debugType = self::LOG

$oldDebugType

private mixed $oldDebugType = self::NONE

Methods

Add()

Add an item to the debug array object

public Add(mixed $debug) : mixed
@param 	string 	$debug 		debug item
Parameters
$debug : mixed

AddError()

Adds an error to the debugger

public AddError(Exception $err) : mixed
Parameters
$err : Exception

Exception

AddQuery()

Adds a query to the debug

public AddQuery(string $sql, string $values) : mixed
Parameters
$sql : string

query to be debugged

$values : string

values to be added to the query

BackTemp()

After temporarily setting a debugging type, gets it back to what it was

public BackTemp() : Debugger
Return values
Debugger

Error()

Adds an error to the debugger

public Error(Exception $err) : mixed
Parameters
$err : Exception

Exception

GetType()

Returns the debug type

public GetType() : string
Return values
string

Debug type (Dev, Debug, Log, None)

GetTypeDesc()

Returns the debug type in a descritive format

public GetTypeDesc() : string
Return values
string

Debug type (Dev, Debug, Log, None)

Info()

Add an info item to the debug array object

public Info(mixed $debug) : mixed
@param 		string 		$debug 		info item
Parameters
$debug : mixed

LogQueries()

Should debugger log queries?

public LogQueries(bool $q) : Debugger
Parameters
$q : bool

true for logging queries, false for not

Return values
Debugger

SetInstance()

public SetInstance(mixed $inst) : mixed
Parameters
$inst : mixed

SetLogFile()

Set the name of log file that will be used (it will be created inside "*logs*" folder)

public SetLogFile(string $file) : Debugger
Parameters
$file : string

log file name

Return values
Debugger

SetTemp()

Sets a debugger type temporarily (usefull when need to check a specific operation, for example)

public SetTemp(string $dType) : Debugger
Parameters
$dType : string

type to be temporarily set

Return values
Debugger

SetType()

Sets the debugger method It can be: *DEV*, *DEBUG*, *LOG*, *NONE* => **Debugger::DEV** = Will print the debugs as it appears in the code **Debugger::DEBUG** = Will store all the debugs and print it later **Debugger::LOG** = Will log queries and other debugs in the code **Debugger::NONE** = Well... nothing to do, heh? Default: **LOG**

public SetType( $type) : Debugger
Parameters
$type :

integer type to be set

Return values
Debugger

Show()

Prints the debug

public Show() : mixed

Trace()

Trace error location

public Trace() : mixed

__construct()

private final __construct() : mixed

printsDebug()

prints every single line in p_r()

private printsDebug(mixed $deb) : mixed
Parameters
$deb : mixed

printTrace()

gets a trace array and returns a beautiful way of it printed

private printTrace(array<string|int, mixed> $trace) : string
Parameters
$trace : array<string|int, mixed>

trace

Return values
string

html of the trace printed


        
On this page

Search results