Skip to content
This repository was archived by the owner on Apr 9, 2026. It is now read-only.

Commit 643b5eb

Browse files
committed
Minor
1 parent 565d721 commit 643b5eb

4 files changed

Lines changed: 22 additions & 14 deletions

File tree

Plugin.php

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,13 @@
33
use App;
44
use Event;
55
use Config;
6-
use BackendAuth;
76
use Backend\Models\UserRole;
87
use System\Classes\PluginBase;
98
use System\Classes\CombineAssets;
109
use Illuminate\Foundation\AliasLoader;
1110

1211
/**
13-
* Debugbar Plugin Information File
14-
*
15-
* TODO:
16-
* - Fix styling by scoping a html reset to phpdebugbar-openhandler and phpdebugbar
12+
* Plugin Information File
1713
*/
1814
class Plugin extends PluginBase
1915
{
@@ -51,21 +47,23 @@ public function boot()
5147

5248
// Register alias
5349
$alias = AliasLoader::getInstance();
54-
$alias->alias('Debugbar', '\Barryvdh\Debugbar\Facade');
50+
$alias->alias('Debugbar', \Barryvdh\Debugbar\Facade::class);
5551

5652
// Register middleware
5753
if (Config::get('app.debugAjax', false)) {
58-
$this->app['Illuminate\Contracts\Http\Kernel']->pushMiddleware('\RainLab\Debugbar\Middleware\InterpretsAjaxExceptions');
54+
$this->app['Illuminate\Contracts\Http\Kernel']->pushMiddleware(\RainLab\Debugbar\Middleware\InterpretsAjaxExceptions::class);
5955
}
6056

6157
// Add styling
62-
$addResources = function ($controller) {
63-
$debugBar = $this->app->make('Barryvdh\Debugbar\LaravelDebugbar');
58+
$addResources = function($controller) {
59+
$debugBar = $this->app->make(\Barryvdh\Debugbar\LaravelDebugbar::class);
6460
if ($debugBar->isEnabled()) {
6561
$controller->addCss(url(Config::get('cms.pluginsPath', '/plugins') . '/rainlab/debugbar/assets/css/debugbar.css'));
6662
}
6763
};
64+
6865
Event::listen('backend.page.beforeDisplay', $addResources, PHP_INT_MAX);
66+
6967
Event::listen('cms.page.beforeDisplay', $addResources, PHP_INT_MAX);
7068

7169
Event::listen('cms.page.beforeDisplay', function ($controller, $url, $page) {

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ Easily see what's going on under the hood of your October application.
44

55
# Installation
66

7+
To install from the [Marketplace](https://octobercms.com/plugin/rainlab-debugbar), click on the "Add to Project" button and then select the project you wish to add it to and pay for the plugin. Once the plugin has been added to the project, go to the backend and check for updates to pull in the plugin.
8+
9+
To install from the backend, go to **Settings -> Updates & Plugins -> Install Plugins** and then search for `RainLab.DebugBar`.
10+
711
To install from [the repository](https://github.com/rainlab/debugbar-plugin), clone it into **plugins/rainlab/debugbar** and then run `composer update` from your project root in order to pull in the dependencies.
812

913
To install it with Composer, run `composer require rainlab/debugbar-plugin` from your project root.
@@ -14,4 +18,4 @@ Set `debug` to `true` in `config/app.php`, and the debugbar should appear on you
1418

1519
See [barryvdh/laravel-debugbar](https://github.com/barryvdh/laravel-debugbar) for more usage instructions and documentation.
1620

17-
To include exceptions in the response header of ajax calls set `debugAjax` to `true` in `config/app.php`.
21+
To include exceptions in the response header of ajax calls set `debugAjax` to `true` in `config/app.php`.

classes/ServiceProvider.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
use Illuminate\Contracts\Http\Kernel;
44
use Barryvdh\Debugbar\ServiceProvider as BaseServiceProvider;
5-
65
use RainLab\Debugbar\Middleware\InjectDebugbar;
76

7+
/**
8+
* ServiceProvider
9+
*/
810
class ServiceProvider extends BaseServiceProvider
911
{
1012
/**
@@ -15,6 +17,7 @@ class ServiceProvider extends BaseServiceProvider
1517
protected function registerMiddleware($middleware)
1618
{
1719
$kernel = $this->app[Kernel::class];
20+
1821
$kernel->pushMiddleware(InjectDebugbar::class);
1922
}
20-
}
23+
}

middleware/InjectDebugbar.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php namespace RainLab\Debugbar\Middleware;
22

3+
use Error;
34
use Config;
45
use Request;
56
use Closure;
@@ -28,9 +29,11 @@ public function handle($request, Closure $next)
2829
try {
2930
/** @var \Illuminate\Http\Response $response */
3031
$response = $next($request);
31-
} catch (Exception $e) {
32+
}
33+
catch (Exception $e) {
3234
$response = $this->handleException($request, $e);
33-
} catch (Error $error) {
35+
}
36+
catch (Error $error) {
3437
$e = new FatalThrowableError($error);
3538
$response = $this->handleException($request, $e);
3639
}

0 commit comments

Comments
 (0)