DebugBar
class DebugBar (View source)
A simple helper
Traits
Provides extensions to this object to integrate it with standard config API methods.
A class that can be instantiated or replaced via DI
Properties
protected static | DebugBar | $debugbar | ||
public static | bool | $bufferingEnabled | ||
protected static | JavascriptRenderer | $renderer | ||
protected static | bool | $showQueries | ||
protected static | HTTPRequest | $request | ||
protected static | array | $extraTimes |
Methods
Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .....).
Gets the uninherited value for the given config option
An implementation of the factory method, allows you to create an instance of a class
Creates a class instance by the "singleton" design pattern.
Access a protected property when the api does not allow access
Set a protected property when the api does not allow access
Details
static Config_ForClass
config()
Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .....).
mixed
stat(string $name)
deprecated
deprecated
Get inherited config value
mixed
uninherited(string $name)
Gets the uninherited value for the given config option
$this
set_stat(string $name, mixed $value)
deprecated
deprecated
Update the config value for a given property
static Injectable
create(mixed ...$args)
An implementation of the factory method, allows you to create an instance of a class
This method will defer class substitution to the Injector API, which can be customised via the Config API to declare substitution classes.
This can be called in one of two ways - either calling via the class directly, or calling on Object and passing the class name as the first parameter. The following are equivalent: $list = DataList::create(SiteTree::class); $list = SiteTree::get();
static Injectable
singleton(string $class = null)
Creates a class instance by the "singleton" design pattern.
It will always return the same instance for this class, which can be used for performance reasons and as a simple way to access instance methods which don't rely on instance data (e.g. the custom SilverStripe static handling).
static DebugBar
getDebugBar()
Get the Debug Bar instance
static DebugBar|null
initDebugBar()
Init the debugbar instance
static protected mixed
getProtectedValue(object $object, string $property)
Access a protected property when the api does not allow access
static protected void
setProtectedValue(object $object, string $property, mixed $newValue)
Set a protected property when the api does not allow access
static void
clearDebugBar()
Clear the current instance of DebugBar
static bool
getShowQueries()
No description
static void
setShowQueries(bool $showQueries)
Override default showQueries mode
static ModuleResource
moduleResource(string $path)
Helper to access this module resources
static void
includeRequirements()
Include DebugBar assets using Requirements API
static string
renderDebugBar()
Returns the script to display the DebugBar
static array
disabledCriteria()
Get all criteria why the DebugBar could be disabled
static string
whyDisabled()
Determine why DebugBar is disabled
Deprecated in favor of disabledCriteria
static
vendorNotInstalled()
No description
static
notLocalIp()
No description
static
allowAllEnvironments()
No description
static
isDisabled()
No description
static
isDevUrl()
No description
static
isAdminUrl()
No description
static
isAdminController()
No description
static bool
isDebugBarRequest()
Avoid triggering data collection for open handler
static string
getRequestUrl()
Get request url
static
withDebugBar(callable $callback)
Helper to make code cleaner
static
setRequest(HTTPRequest $request)
Set the current request. Is provided by the DebugBarMiddleware.
static HTTPRequest
getRequest()
Get the current request
static TimeDataCollector|false
getTimeCollector()
No description
static MessagesCollector|false
getMessageCollector()
No description
static void
trackTime(string $label)
Start/stop time tracking (also before init)
static void
closeExtraTime()
Close any open extra time record
static
measureExtraTime()
Add extra time to time collector