Debugbar/Clockwork Toggle.

This commit is contained in:
Andy Miller
2019-05-27 19:20:21 +03:00
parent 136ec07450
commit f4645fc77e
3 changed files with 1427 additions and 1412 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -125,6 +125,7 @@ log:
debugger:
enabled: false # Enable Grav debugger and following settings
provider: debugbar # Debugger provider
shutdown:
close_connection: true # Close the connection before calling onShutdown(). false for debugging

View File

@@ -116,11 +116,15 @@ class Debugger
if ($this->enabled) {
$this->initialized = true;
// Clockwork initialization.
$this->clockwork = $clockwork = new Clockwork();
$clockwork = $debugbar = null;
// Debugbar initialization.
$this->debugbar = $debugbar = new DebugBar();
switch ($this->config->get('system.debugger.provider', 'debugbar')) {
case 'clockwork':
$this->clockwork = $clockwork = new Clockwork();
break;
default:
$this->debugbar = $debugbar = new DebugBar();
}
$plugins_config = (array)$this->config->get('plugins');
ksort($plugins_config);
@@ -164,7 +168,7 @@ class Debugger
$debugbar['time']->addMeasure('Site Setup', $this->currentTime, microtime(true));
}
$this->addMessage('Grav v' . GRAV_VERSION);
$this->addMessage('Grav v' . GRAV_VERSION . ' - PHP ' . PHP_VERSION);
$this->config->debug();
if ($clockwork) {