|
3 | 3 | use App; |
4 | 4 | use Event; |
5 | 5 | use Config; |
6 | | -use BackendAuth; |
7 | 6 | use Backend\Models\UserRole; |
8 | 7 | use System\Classes\PluginBase; |
9 | 8 | use System\Classes\CombineAssets; |
10 | 9 | use Illuminate\Foundation\AliasLoader; |
11 | 10 |
|
12 | 11 | /** |
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 |
17 | 13 | */ |
18 | 14 | class Plugin extends PluginBase |
19 | 15 | { |
@@ -51,21 +47,23 @@ public function boot() |
51 | 47 |
|
52 | 48 | // Register alias |
53 | 49 | $alias = AliasLoader::getInstance(); |
54 | | - $alias->alias('Debugbar', '\Barryvdh\Debugbar\Facade'); |
| 50 | + $alias->alias('Debugbar', \Barryvdh\Debugbar\Facade::class); |
55 | 51 |
|
56 | 52 | // Register middleware |
57 | 53 | 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); |
59 | 55 | } |
60 | 56 |
|
61 | 57 | // 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); |
64 | 60 | if ($debugBar->isEnabled()) { |
65 | 61 | $controller->addCss(url(Config::get('cms.pluginsPath', '/plugins') . '/rainlab/debugbar/assets/css/debugbar.css')); |
66 | 62 | } |
67 | 63 | }; |
| 64 | + |
68 | 65 | Event::listen('backend.page.beforeDisplay', $addResources, PHP_INT_MAX); |
| 66 | + |
69 | 67 | Event::listen('cms.page.beforeDisplay', $addResources, PHP_INT_MAX); |
70 | 68 |
|
71 | 69 | Event::listen('cms.page.beforeDisplay', function ($controller, $url, $page) { |
|
0 commit comments