Add Smarty collector to debug bar

This commit is contained in:
Pierre Rudloff 2021-02-07 00:03:37 +01:00
parent bba5090ec3
commit 9af922f3f1
3 changed files with 52 additions and 4 deletions

View file

@ -7,6 +7,7 @@
namespace Alltube\Factory;
use Alltube\LocaleManager;
use Junker\DebugBar\Bridge\SmartyCollector;
use Psr\Container\ContainerInterface;
use Slim\Http\Request;
use Slim\Http\Uri;
@ -86,10 +87,15 @@ class ViewFactory
$view->offsetSet('domain', $uri->withBasePath('')->getBaseUrl());
if ($container->has('debugbar')) {
$debugBar = $container->get('debugbar');
$debugBar->addCollector(new SmartyCollector($view->getSmarty()));
$view->offsetSet(
'debug_render',
$container->get('debugbar')
->getJavascriptRenderer($uri->getBaseUrl() . '/vendor/maximebf/debugbar/src/DebugBar/Resources/')
$debugBar->getJavascriptRenderer(
$uri->getBaseUrl() . '/vendor/maximebf/debugbar/src/DebugBar/Resources/'
)
);
}

View file

@ -44,6 +44,7 @@
"enlightn/security-checker": "^1.4",
"ergebnis/composer-normalize": "^2.6",
"insite/composer-dangling-locked-deps": "^0.2.1",
"junker/debugbar-smarty": "dev-master",
"maximebf/debugbar": "^1.16",
"php-mock/php-mock-mockery": "^1.3",
"phpro/grumphp": "^1.1",

45
composer.lock generated
View file

@ -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": "8f0982143c6c873f68d41017e195387a",
"content-hash": "ce151882c06d9b14d20fee47cb22be42",
"packages": [
{
"name": "aura/session",
@ -3999,6 +3999,45 @@
"description": "Detect dangling Composer locked dependencies",
"time": "2020-11-16T13:45:00+00:00"
},
{
"name": "junker/debugbar-smarty",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/Junker/php-debugbar-smarty.git",
"reference": "82fb0d47799d2e030ecaa95cb16ad0ad53261e79"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Junker/php-debugbar-smarty/zipball/82fb0d47799d2e030ecaa95cb16ad0ad53261e79",
"reference": "82fb0d47799d2e030ecaa95cb16ad0ad53261e79",
"shasum": ""
},
"type": "library",
"autoload": {
"psr-0": {
"Junker": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Dmitry Kosenkov",
"email": "dk-junker@ya.ru"
}
],
"description": "Smarty Collector for PHP DebugBar",
"keywords": [
"PHP debugbar",
"collector",
"debugbar",
"smarty"
],
"time": "2021-02-06T14:00:09+00:00"
},
{
"name": "justinrainbow/json-schema",
"version": "5.2.10",
@ -7064,7 +7103,9 @@
],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"stability-flags": {
"junker/debugbar-smarty": 20
},
"prefer-stable": false,
"prefer-lowest": false,
"platform": {