nimblephp / debugbar
Debugbar for NimblePHP
Requires
- php: >=8.2
- krzysztofzylka/generator: ^1.0
- nimblephp/framework: >=0.4.2
- php-debugbar/php-debugbar: v3.4.0
- dev-main
- 0.3.4
- 0.3.3
- 0.3.2
- 0.3.1
- 0.3.0
- 0.2.10
- 0.2.9
- 0.2.8
- 0.2.7
- 0.2.6
- 0.2.5
- 0.2.4
- 0.2.3
- 0.2.2
- 0.2.1
- 0.2.0
- 0.1.11
- 0.1.10
- 0.1.9
- 0.1.8
- 0.1.7
- 0.1.6
- 0.1.5
- 0.1.4
- 0.1.3
- 0.1.2
- 0.1.1
- 0.1.0
- dev-1654-poprawa-bledu-middleware-jezeli-debug-jest-wylaczony
- dev-1645-poprawa-bledu-z-nieznalezionym-elementem-debugbar-fixed-uri
This package is auto-updated.
Last update: 2026-02-23 21:15:55 UTC
README
Debugbar jest modułem który umożliwia w łatwy sposób zintegrować PHP Debugbar do projektu opartego na NimblePHP
Dokumentacja projektu dostępna jest pod linkiem: https://nimblemvc.github.io/documentation/extension/debugbar/start/#
Instalacja
composer require nimblephp/debugbar
Użycie
Po zainstalowaniu composera tworzymy lub edytujemy plik Middleware.php i wklejamy w metodę afterBootstrap następujący kod:
(new Debugbar())->init();
Dodajemy w szablonie:
echo \NimblePHP\Debugbar\Debugbar::renderHeader();
Teraz zainicjował się debugbar i możemy go ustawić w index.php na końcu
echo \NimblePHP\debugbar\Debugbar::render();
Gotowy plik Middleware.php z wyliczaniem czasu ładowania kontrolera oraz zwróceniem błędów
<?php use NimblePHP\debugbar\Debugbar; class Middleware extends \NimblePHP\Framework\Middleware { public function afterBootstrap() { (new Debugbar())->init(); } public function handleException(Throwable $exception) { \NimblePHP\Debugbar\Debugbar::$debugBar['exceptions']->addThrowable($exception); } public function beforeController(string $controllerName, string $action, array $params) { \NimblePHP\Debugbar\Debugbar::$debugBar['time']->startMeasure('load-controller-' . $controllerName . $action, 'Load ' . str_replace('\src\Controller\\', '', $controllerName) . ' controller'); } public function afterController(string $controllerName, string $action, array $params) { \NimblePHP\Debugbar\Debugbar::$debugBar['time']->stopMeasure('load-controller-' . $controllerName . $action); if (!Debugbar::$debugBar->hasCollector('module_register')) { Debugbar::$debugBar->addCollector(new \NimblePHP\Debugbar\Collectors\ModuleCollector(\NimblePHP\Framework\ModuleRegister::getAll())); } } }
Współtworzenie
Zachęcamy do współtworzenia! Masz sugestie, znalazłeś błędy, chcesz pomóc w rozwoju? Otwórz issue lub prześlij pull request.
Pomoc
Wszelkie problemy oraz pytania należy zadawać przez zakładkę discussions w github pod linkiem: https://github.com/NimbleMVC/Migrations/discussions