PHP Class Barryvdh\Debugbar\LaravelDebugbar

Rest is added in Service Provider
Inheritance: extends DebugBar\DebugBar
Datei anzeigen Open project: barryvdh/laravel-debugbar Class Usage Examples

Protected Properties

Property Type Description
$app Illuminate\Foundation\Application The Laravel application instance.
$booted boolean True when booted.
$enabled boolean True when enabled, false disabled an null for still unknown
$is_lumen boolean True when this is a Lumen application
$version string Normalized Laravel Version

Public Methods

Method Description
__call ( string $method, array $args ) : mixed | void Magic calls for adding messages
__construct ( Illuminate\Contracts\Foundation\Application $app = null )
addException ( Exception $e ) Adds an exception to be profiled in the debug bar
addMeasure ( string $label, float $start, float $end ) Adds a measure
addMessage ( mixed $message, string $label = 'info' ) Adds a message to the MessagesCollector
addThrowable ( Exception $e ) Adds an exception to be profiled in the debug bar
boot ( ) Boot the debugbar (add collectors, renderer and listener)
collect ( ) : array Collects the data from the collectors
collectConsole ( ) : array Collect data in a CLI request
disable ( ) Disable the Debugbar
enable ( ) Enable the Debugbar and boot, if not already booted.
getJavascriptRenderer ( string $baseUrl = null, $basePath = null ) : JavascriptRenderer Returns a JavascriptRenderer for this instance
injectDebugbar ( Response $response ) Injects the web debug toolbar into the given Response.
isEnabled ( ) : boolean Check if the Debugbar is enabled
measure ( string $label, Closure $closure ) Utility function to measure the execution of a Closure
modifyResponse ( Request $request, Response $response ) : Response Modify the response and inject the debugbar (or data in headers)
shouldCollect ( $name, $default = false )
startMeasure ( string $name, string $label = null ) Starts a measure
stopMeasure ( string $name ) Stops a measure

Protected Methods

Method Description
addClockworkHeaders ( Response $response )
checkVersion ( string $version, string $operator = ">=" ) : boolean Check the version of Laravel
isDebugbarRequest ( ) : boolean Check if this is a request to the Debugbar OpenHandler
isJsonRequest ( Request $request ) : boolean
isLumen ( )
selectStorage ( DebugBar\DebugBar $debugbar )

Method Details

__call() public method

Magic calls for adding messages
public __call ( string $method, array $args ) : mixed | void
$method string
$args array
return mixed | void

__construct() public method

public __construct ( Illuminate\Contracts\Foundation\Application $app = null )
$app Illuminate\Contracts\Foundation\Application

addClockworkHeaders() protected method

protected addClockworkHeaders ( Response $response )
$response Symfony\Component\HttpFoundation\Response

addException() public method

Adds an exception to be profiled in the debug bar
Deprecation: in favor of addThrowable
public addException ( Exception $e )
$e Exception

addMeasure() public method

Adds a measure
public addMeasure ( string $label, float $start, float $end )
$label string
$start float
$end float

addMessage() public method

A message can be anything from an object to a string
public addMessage ( mixed $message, string $label = 'info' )
$message mixed
$label string

addThrowable() public method

Adds an exception to be profiled in the debug bar
public addThrowable ( Exception $e )
$e Exception

boot() public method

Boot the debugbar (add collectors, renderer and listener)
public boot ( )

checkVersion() protected method

Check the version of Laravel
protected checkVersion ( string $version, string $operator = ">=" ) : boolean
$version string
$operator string (default: '>=')
return boolean

collect() public method

Collects the data from the collectors
public collect ( ) : array
return array

collectConsole() public method

Collect data in a CLI request
public collectConsole ( ) : array
return array

disable() public method

Disable the Debugbar
public disable ( )

enable() public method

Enable the Debugbar and boot, if not already booted.
public enable ( )

getJavascriptRenderer() public method

Returns a JavascriptRenderer for this instance
public getJavascriptRenderer ( string $baseUrl = null, $basePath = null ) : JavascriptRenderer
$baseUrl string
return JavascriptRenderer

injectDebugbar() public method

Injects the web debug toolbar into the given Response.
public injectDebugbar ( Response $response )
$response Symfony\Component\HttpFoundation\Response A Response instance Based on https://github.com/symfony/WebProfilerBundle/blob/master/EventListener/WebDebugToolbarListener.php

isDebugbarRequest() protected method

Check if this is a request to the Debugbar OpenHandler
protected isDebugbarRequest ( ) : boolean
return boolean

isEnabled() public method

Check if the Debugbar is enabled
public isEnabled ( ) : boolean
return boolean

isJsonRequest() protected method

protected isJsonRequest ( Request $request ) : boolean
$request Symfony\Component\HttpFoundation\Request
return boolean

isLumen() protected method

protected isLumen ( )

measure() public method

Utility function to measure the execution of a Closure
public measure ( string $label, Closure $closure )
$label string
$closure Closure

modifyResponse() public method

Modify the response and inject the debugbar (or data in headers)
public modifyResponse ( Request $request, Response $response ) : Response
$request Symfony\Component\HttpFoundation\Request
$response Symfony\Component\HttpFoundation\Response
return Symfony\Component\HttpFoundation\Response

selectStorage() protected method

protected selectStorage ( DebugBar\DebugBar $debugbar )
$debugbar DebugBar\DebugBar

shouldCollect() public method

public shouldCollect ( $name, $default = false )

startMeasure() public method

Starts a measure
public startMeasure ( string $name, string $label = null )
$name string Internal name, used to stop the measure
$label string Public name

stopMeasure() public method

Stops a measure
public stopMeasure ( string $name )
$name string

Property Details

$app protected_oe property

The Laravel application instance.
protected Application,Illuminate\Foundation $app
return Illuminate\Foundation\Application

$booted protected_oe property

True when booted.
protected bool $booted
return boolean

$enabled protected_oe property

True when enabled, false disabled an null for still unknown
protected bool $enabled
return boolean

$is_lumen protected_oe property

True when this is a Lumen application
protected bool $is_lumen
return boolean

$version protected_oe property

Normalized Laravel Version
protected string $version
return string