Documentation

Debugger
in package

Class Debugger

Table of Contents

Properties

$censored  : bool
$clockwork  : Clockwork|null
$config  : Config|null
$currentTime  : float
$debugbar  : DebugBar|null
$deprecations  : array<string|int, mixed>
$enabled  : bool
$errorHandler  : callable|null
$grav  : Grav|null
$initialized  : bool
$instance  : static
$profiling  : int
$renderer  : JavascriptRenderer|null
$requestTime  : float
$timers  : array<string|int, mixed>

Methods

__construct()  : mixed
Debugger constructor.
addAssets()  : $this
Add the debugger assets to the Grav Assets
addCollector()  : $this
Adds a data collector
addEvent()  : $this
addException()  : Debugger
Dump exception into the Messages tab of the Debug Bar
addMessage()  : $this
Dump variables into the Messages tab of the Debug Bar
addTwigProfiler()  : void
debuggerRequest()  : Response
deprecatedErrorHandler()  : bool
enabled()  : bool
Set/get the enabled state of the debugger
finalize()  : void
getCaller()  : array<string|int, mixed>
getClockwork()  : Clockwork|null
getCollector()  : DataCollectorInterface|null
Returns a data collector
getData()  : array<string|int, mixed>|null
Returns collected debugger data.
init()  : $this
Initialize the debugger
logRequest()  : ResponseInterface
profile()  : mixed
Hierarchical Profiler support.
render()  : $this
Displays the debug bar
sendDataInHeaders()  : $this
Sends the data through the HTTP headers
setErrorHandler()  : void
startProfiling()  : void
Start profiling code.
startTimer()  : $this
Start a timer with an associated name and description
stopProfiling()  : array<string|int, mixed>|null
Stop profiling code. Returns profiling array or null if profiling couldn't be done.
stopTimer()  : $this
Stop the named timer
addDeprecations()  : void
addMeasures()  : void
buildProfilerTimings()  : array<string|int, mixed>
getDepracatedMessage()  : array<string|int, mixed>
getDeprecations()  : array<string|int, mixed>
getFunction()  : string
parseProfilerCall()  : mixed|string|null
resolveCallable()  : string

Properties

$censored

protected bool $censored = false

$clockwork

protected Clockwork|null $clockwork

$currentTime

protected float $currentTime

$debugbar

protected DebugBar|null $debugbar

$deprecations

protected array<string|int, mixed> $deprecations = []

$enabled

protected bool $enabled = false

$errorHandler

protected callable|null $errorHandler

$initialized

protected bool $initialized = false

$instance

protected static static $instance

$renderer

protected JavascriptRenderer|null $renderer

$requestTime

protected float $requestTime

$timers

protected array<string|int, mixed> $timers = []

Methods

__construct()

Debugger constructor.

public __construct() : mixed

addAssets()

Add the debugger assets to the Grav Assets

public addAssets() : $this
Return values
$this

addCollector()

Adds a data collector

public addCollector(DataCollectorInterface $collector) : $this
Parameters
$collector : DataCollectorInterface
Tags
throws
DebugBarException
Return values
$this

addEvent()

public addEvent(string $name, object $event, EventDispatcherInterface $dispatcher[, float|null $time = null ]) : $this
Parameters
$name : string
$event : object
$dispatcher : EventDispatcherInterface
$time : float|null = null
Return values
$this

addException()

Dump exception into the Messages tab of the Debug Bar

public addException(Throwable $e) : Debugger
Parameters
$e : Throwable
Return values
Debugger

addMessage()

Dump variables into the Messages tab of the Debug Bar

public addMessage(mixed $message[, string $label = 'info' ][, mixed|bool $isString = true ]) : $this
Parameters
$message : mixed
$label : string = 'info'
$isString : mixed|bool = true
Return values
$this

addTwigProfiler()

public addTwigProfiler(Environment $twig) : void
Parameters
$twig : Environment

debuggerRequest()

public debuggerRequest(RequestInterface $request) : Response
Parameters
$request : RequestInterface
Return values
Response

deprecatedErrorHandler()

public deprecatedErrorHandler(int $errno, string $errstr, string $errfile, int $errline) : bool
Parameters
$errno : int
$errstr : string
$errfile : string
$errline : int
Return values
bool

enabled()

Set/get the enabled state of the debugger

public enabled([bool|null $state = null ]) : bool
Parameters
$state : bool|null = null

If null, the method returns the enabled value. If set, the method sets the enabled state

Return values
bool

getCaller()

public getCaller([int $limit = 2 ]) : array<string|int, mixed>
Parameters
$limit : int = 2
Return values
array<string|int, mixed>

getClockwork()

public getClockwork() : Clockwork|null
Return values
Clockwork|null

getCollector()

Returns a data collector

public getCollector(string $name) : DataCollectorInterface|null
Parameters
$name : string
Tags
throws
DebugBarException
Return values
DataCollectorInterface|null

getData()

Returns collected debugger data.

public getData() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|null

init()

Initialize the debugger

public init() : $this
Tags
throws
DebugBarException
Return values
$this

logRequest()

public logRequest(ServerRequestInterface $request, ResponseInterface $response) : ResponseInterface
Parameters
$request : ServerRequestInterface
$response : ResponseInterface
Return values
ResponseInterface

profile()

Hierarchical Profiler support.

public profile(callable $callable[, string|null $message = null ]) : mixed
Parameters
$callable : callable
$message : string|null = null

render()

Displays the debug bar

public render() : $this
Return values
$this

sendDataInHeaders()

Sends the data through the HTTP headers

public sendDataInHeaders() : $this
Return values
$this

setErrorHandler()

public setErrorHandler() : void

startProfiling()

Start profiling code.

public startProfiling() : void

startTimer()

Start a timer with an associated name and description

public startTimer(string $name[, string|null $description = null ]) : $this
Parameters
$name : string
$description : string|null = null
Return values
$this

stopProfiling()

Stop profiling code. Returns profiling array or null if profiling couldn't be done.

public stopProfiling([string|null $message = null ]) : array<string|int, mixed>|null
Parameters
$message : string|null = null
Return values
array<string|int, mixed>|null

stopTimer()

Stop the named timer

public stopTimer(string $name) : $this
Parameters
$name : string
Return values
$this

addDeprecations()

protected addDeprecations() : void
Tags
throws
DebugBarException

addMeasures()

protected addMeasures() : void

buildProfilerTimings()

protected buildProfilerTimings(array<string|int, mixed> $timings) : array<string|int, mixed>
Parameters
$timings : array<string|int, mixed>
Return values
array<string|int, mixed>

getDepracatedMessage()

protected getDepracatedMessage(array<string|int, mixed> $deprecated) : array<string|int, mixed>
Parameters
$deprecated : array<string|int, mixed>
Return values
array<string|int, mixed>

getDeprecations()

protected getDeprecations() : array<string|int, mixed>
Return values
array<string|int, mixed>

getFunction()

protected getFunction(array<string|int, mixed> $trace) : string
Parameters
$trace : array<string|int, mixed>
Return values
string

parseProfilerCall()

protected parseProfilerCall(string|null $call) : mixed|string|null
Parameters
$call : string|null
Return values
mixed|string|null

resolveCallable()

protected resolveCallable(callable $callable) : string
Parameters
$callable : callable
Return values
string

        
On this page

Search results