Skip to content

Commit

Permalink
Merge pull request cakephp#725 from cakephp/skip-cli
Browse files Browse the repository at this point in the history
Skip DebugKit on CLI
  • Loading branch information
dereuromark authored Jan 1, 2020
2 parents c2b18c9 + 38ff351 commit 6ce871a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,13 @@ class Plugin extends BasePlugin
public function bootstrap(PluginApplicationInterface $app): void
{
$service = new ToolbarService(EventManager::instance(), (array)Configure::read('DebugKit'));
$this->service = $service;

if (!$service->isEnabled() || php_sapi_name() === 'cli' || php_sapi_name() === 'phpdbg') {
return;
}

$this->service = $service;

$this->setDeprecationHandler($service);

// will load `config/bootstrap.php`.
Expand Down

0 comments on commit 6ce871a

Please sign in to comment.