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
$config
protected
Config|null
$config
$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
$grav
protected
Grav|null
$grav
$initialized
protected
bool
$initialized
= false
$instance
protected
static static
$instance
$profiling
protected
int
$profiling
= 0
$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
$thisaddCollector()
Adds a data collector
public
addCollector(DataCollectorInterface $collector) : $this
Parameters
- $collector : DataCollectorInterface
Tags
Return values
$thisaddEvent()
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
$thisaddException()
Dump exception into the Messages tab of the Debug Bar
public
addException(Throwable $e) : Debugger
Parameters
- $e : Throwable
Return values
DebuggeraddMessage()
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
$thisaddTwigProfiler()
public
addTwigProfiler(Environment $twig) : void
Parameters
- $twig : Environment
debuggerRequest()
public
debuggerRequest(RequestInterface $request) : Response
Parameters
- $request : RequestInterface
Return values
ResponsedeprecatedErrorHandler()
public
deprecatedErrorHandler(int $errno, string $errstr, string $errfile, int $errline) : bool
Parameters
- $errno : int
- $errstr : string
- $errfile : string
- $errline : int
Return values
boolenabled()
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
boolfinalize()
public
finalize() : void
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|nullgetCollector()
Returns a data collector
public
getCollector(string $name) : DataCollectorInterface|null
Parameters
- $name : string
Tags
Return values
DataCollectorInterface|nullgetData()
Returns collected debugger data.
public
getData() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|nullinit()
Initialize the debugger
public
init() : $this
Tags
Return values
$thislogRequest()
public
logRequest(ServerRequestInterface $request, ResponseInterface $response) : ResponseInterface
Parameters
- $request : ServerRequestInterface
- $response : ResponseInterface
Return values
ResponseInterfaceprofile()
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
$thissendDataInHeaders()
Sends the data through the HTTP headers
public
sendDataInHeaders() : $this
Return values
$thissetErrorHandler()
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
$thisstopProfiling()
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>|nullstopTimer()
Stop the named timer
public
stopTimer(string $name) : $this
Parameters
- $name : string
Return values
$thisaddDeprecations()
protected
addDeprecations() : void
Tags
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
stringparseProfilerCall()
protected
parseProfilerCall(string|null $call) : mixed|string|null
Parameters
- $call : string|null
Return values
mixed|string|nullresolveCallable()
protected
resolveCallable(callable $callable) : string
Parameters
- $callable : callable