From abd8d8c80ccdfc2ba79909cd2058680694e1ec6b Mon Sep 17 00:00:00 2001 From: Kamil Niemczycki Date: Tue, 19 Apr 2022 14:21:23 +0200 Subject: [PATCH] Added debugbar --- composer.json | 2 +- composer.lock | 217 +++++++++++++++++++++++++++++++----- config/debugbar.php | 92 +++++++++++++++ storage/debugbar/.gitignore | 2 + 4 files changed, 283 insertions(+), 30 deletions(-) create mode 100644 config/debugbar.php create mode 100644 storage/debugbar/.gitignore diff --git a/composer.json b/composer.json index 2a34a0a..3b7425c 100644 --- a/composer.json +++ b/composer.json @@ -13,9 +13,9 @@ "laravel/tinker": "^2.5" }, "require-dev": { + "barryvdh/laravel-debugbar": "^3.6", "facade/ignition": "^2.5", "fakerphp/faker": "^1.9.1", - "laravel/sail": "^1.0.1", "mockery/mockery": "^1.4.4", "nunomaduro/collision": "^5.10", "phpunit/phpunit": "^9.5.10" diff --git a/composer.lock b/composer.lock index 8946327..ffb458a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f0bfc04fb8cb3f7546e3b41cfcedda44", + "content-hash": "984f9e020c7324db66137ffb9fb98ce9", "packages": [ { "name": "asm89/stack-cors", @@ -5384,6 +5384,91 @@ } ], "packages-dev": [ + { + "name": "barryvdh/laravel-debugbar", + "version": "v3.6.7", + "source": { + "type": "git", + "url": "https://github.com/barryvdh/laravel-debugbar.git", + "reference": "b96f9820aaf1ff9afe945207883149e1c7afb298" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/b96f9820aaf1ff9afe945207883149e1c7afb298", + "reference": "b96f9820aaf1ff9afe945207883149e1c7afb298", + "shasum": "" + }, + "require": { + "illuminate/routing": "^6|^7|^8|^9", + "illuminate/session": "^6|^7|^8|^9", + "illuminate/support": "^6|^7|^8|^9", + "maximebf/debugbar": "^1.17.2", + "php": ">=7.2", + "symfony/debug": "^4.3|^5|^6", + "symfony/finder": "^4.3|^5|^6" + }, + "require-dev": { + "mockery/mockery": "^1.3.3", + "orchestra/testbench-dusk": "^4|^5|^6|^7", + "phpunit/phpunit": "^8.5|^9.0", + "squizlabs/php_codesniffer": "^3.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.6-dev" + }, + "laravel": { + "providers": [ + "Barryvdh\\Debugbar\\ServiceProvider" + ], + "aliases": { + "Debugbar": "Barryvdh\\Debugbar\\Facades\\Debugbar" + } + } + }, + "autoload": { + "files": [ + "src/helpers.php" + ], + "psr-4": { + "Barryvdh\\Debugbar\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Barry vd. Heuvel", + "email": "barryvdh@gmail.com" + } + ], + "description": "PHP Debugbar integration for Laravel", + "keywords": [ + "debug", + "debugbar", + "laravel", + "profiler", + "webprofiler" + ], + "support": { + "issues": "https://github.com/barryvdh/laravel-debugbar/issues", + "source": "https://github.com/barryvdh/laravel-debugbar/tree/v3.6.7" + }, + "funding": [ + { + "url": "https://fruitcake.nl", + "type": "custom" + }, + { + "url": "https://github.com/barryvdh", + "type": "github" + } + ], + "time": "2022-02-09T07:52:32+00:00" + }, { "name": "doctrine/instantiator", "version": "1.4.0", @@ -5839,42 +5924,42 @@ "time": "2020-07-09T08:09:16+00:00" }, { - "name": "laravel/sail", - "version": "v1.13.2", + "name": "maximebf/debugbar", + "version": "v1.18.0", "source": { "type": "git", - "url": "https://github.com/laravel/sail.git", - "reference": "ede5e861549be2c3a8b789cdb34203a5aef5b92a" + "url": "https://github.com/maximebf/php-debugbar.git", + "reference": "0d44b75f3b5d6d41ae83b79c7a4bceae7fbc78b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/sail/zipball/ede5e861549be2c3a8b789cdb34203a5aef5b92a", - "reference": "ede5e861549be2c3a8b789cdb34203a5aef5b92a", + "url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/0d44b75f3b5d6d41ae83b79c7a4bceae7fbc78b6", + "reference": "0d44b75f3b5d6d41ae83b79c7a4bceae7fbc78b6", "shasum": "" }, "require": { - "illuminate/console": "^8.0|^9.0", - "illuminate/contracts": "^8.0|^9.0", - "illuminate/support": "^8.0|^9.0", - "php": "^7.3|^8.0" + "php": "^7.1|^8", + "psr/log": "^1|^2|^3", + "symfony/var-dumper": "^2.6|^3|^4|^5|^6" + }, + "require-dev": { + "phpunit/phpunit": "^7.5.20 || ^9.4.2", + "twig/twig": "^1.38|^2.7|^3.0" + }, + "suggest": { + "kriswallsmith/assetic": "The best way to manage assets", + "monolog/monolog": "Log using Monolog", + "predis/predis": "Redis storage" }, - "bin": [ - "bin/sail" - ], "type": "library", "extra": { "branch-alias": { - "dev-master": "1.x-dev" - }, - "laravel": { - "providers": [ - "Laravel\\Sail\\SailServiceProvider" - ] + "dev-master": "1.17-dev" } }, "autoload": { "psr-4": { - "Laravel\\Sail\\": "src/" + "DebugBar\\": "src/DebugBar/" } }, "notification-url": "https://packagist.org/downloads/", @@ -5883,20 +5968,26 @@ ], "authors": [ { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" + "name": "Maxime Bouroumeau-Fuseau", + "email": "maxime.bouroumeau@gmail.com", + "homepage": "http://maximebf.com" + }, + { + "name": "Barry vd. Heuvel", + "email": "barryvdh@gmail.com" } ], - "description": "Docker files for running a basic Laravel application.", + "description": "Debug bar in the browser for php application", + "homepage": "https://github.com/maximebf/php-debugbar", "keywords": [ - "docker", - "laravel" + "debug", + "debugbar" ], "support": { - "issues": "https://github.com/laravel/sail/issues", - "source": "https://github.com/laravel/sail" + "issues": "https://github.com/maximebf/php-debugbar/issues", + "source": "https://github.com/maximebf/php-debugbar/tree/v1.18.0" }, - "time": "2022-02-08T14:14:12+00:00" + "time": "2021-12-27T18:49:48+00:00" }, { "name": "mockery/mockery", @@ -7835,6 +7926,74 @@ ], "time": "2020-09-28T06:39:44+00:00" }, + { + "name": "symfony/debug", + "version": "v4.4.37", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "5de6c6e7f52b364840e53851c126be4d71e60470" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/5de6c6e7f52b364840e53851c126be4d71e60470", + "reference": "5de6c6e7f52b364840e53851c126be4d71e60470", + "shasum": "" + }, + "require": { + "php": ">=7.1.3", + "psr/log": "^1|^2|^3" + }, + "conflict": { + "symfony/http-kernel": "<3.4" + }, + "require-dev": { + "symfony/http-kernel": "^3.4|^4.0|^5.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools to ease debugging PHP code", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/debug/tree/v4.4.37" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-01-02T09:41:36+00:00" + }, { "name": "theseer/tokenizer", "version": "1.2.1", diff --git a/config/debugbar.php b/config/debugbar.php new file mode 100644 index 0000000..9a99b84 --- /dev/null +++ b/config/debugbar.php @@ -0,0 +1,92 @@ + env('DEBUGBAR_ENABLED', null), + 'except' => [ + 'telescope*', + 'horizon*', + ], + 'storage' => [ + 'enabled' => true, + 'driver' => 'file', // redis, file, pdo, socket, custom + 'path' => storage_path('debugbar'), // For file driver + 'connection' => null, // Leave null for default connection (Redis/PDO) + 'provider' => '', // Instance of StorageInterface for custom driver + 'hostname' => '127.0.0.1', // Hostname to use with the "socket" driver + 'port' => 2304, // Port to use with the "socket" driver + ], + 'editor' => env('DEBUGBAR_EDITOR', 'phpstorm'), + 'remote_sites_path' => env('DEBUGBAR_REMOTE_SITES_PATH', ''), + 'local_sites_path' => env('DEBUGBAR_LOCAL_SITES_PATH', ''), + 'include_vendors' => true, + 'capture_ajax' => true, + 'add_ajax_timing' => false, + 'error_handler' => false, + 'clockwork' => false, + 'collectors' => [ + 'phpinfo' => true, // Php version + 'messages' => true, // Messages + 'time' => true, // Time Datalogger + 'memory' => true, // Memory usage + 'exceptions' => true, // Exception displayer + 'log' => true, // Logs from Monolog (merged in messages if enabled) + 'db' => true, // Show database (PDO) queries and bindings + 'views' => true, // Views with their data + 'route' => true, // Current route information + 'auth' => false, // Display Laravel authentication status + 'gate' => true, // Display Laravel Gate checks + 'session' => true, // Display session data + 'symfony_request' => true, // Only one can be enabled.. + 'mail' => true, // Catch mail messages + 'laravel' => false, // Laravel version and environment + 'events' => false, // All events fired + 'default_request' => false, // Regular or special Symfony request logger + 'logs' => false, // Add the latest log messages + 'files' => false, // Show the included files + 'config' => false, // Display config settings + 'cache' => false, // Display cache events + 'models' => true, // Display models + 'livewire' => true, // Display Livewire (when available) + ], + 'options' => [ + 'auth' => [ + 'show_name' => true, // Also show the users name/email in the debugbar + ], + 'db' => [ + 'with_params' => true, // Render SQL with the parameters substituted + 'backtrace' => true, // Use a backtrace to find the origin of the query in your files. + 'backtrace_exclude_paths' => [], // Paths to exclude from backtrace. (in addition to defaults) + 'timeline' => false, // Add the queries to the timeline + 'duration_background' => true, // Show shaded background on each query relative to how long it took to execute. + 'explain' => [ // Show EXPLAIN output on queries + 'enabled' => false, + 'types' => ['SELECT'], // Deprecated setting, is always only SELECT + ], + 'hints' => false, // Show hints for common mistakes + 'show_copy' => false, // Show copy button next to the query + ], + 'mail' => [ + 'full_log' => false, + ], + 'views' => [ + 'timeline' => false, // Add the views to the timeline (Experimental) + 'data' => false, //Note: Can slow down the application, because the data can be quite large.. + ], + 'route' => [ + 'label' => true, // show complete route on bar + ], + 'logs' => [ + 'file' => null, + ], + 'cache' => [ + 'values' => true, // collect cache values + ], + ], + 'inject' => true, + 'route_prefix' => '_debugbar', + 'route_domain' => null, + 'theme' => env('DEBUGBAR_THEME', 'auto'), + 'debug_backtrace_limit' => 50, +]; diff --git a/storage/debugbar/.gitignore b/storage/debugbar/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/storage/debugbar/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore