Add Smarty collector to debug bar
This commit is contained in:
parent
bba5090ec3
commit
9af922f3f1
3 changed files with 52 additions and 4 deletions
|
@ -7,6 +7,7 @@
|
||||||
namespace Alltube\Factory;
|
namespace Alltube\Factory;
|
||||||
|
|
||||||
use Alltube\LocaleManager;
|
use Alltube\LocaleManager;
|
||||||
|
use Junker\DebugBar\Bridge\SmartyCollector;
|
||||||
use Psr\Container\ContainerInterface;
|
use Psr\Container\ContainerInterface;
|
||||||
use Slim\Http\Request;
|
use Slim\Http\Request;
|
||||||
use Slim\Http\Uri;
|
use Slim\Http\Uri;
|
||||||
|
@ -86,10 +87,15 @@ class ViewFactory
|
||||||
$view->offsetSet('domain', $uri->withBasePath('')->getBaseUrl());
|
$view->offsetSet('domain', $uri->withBasePath('')->getBaseUrl());
|
||||||
|
|
||||||
if ($container->has('debugbar')) {
|
if ($container->has('debugbar')) {
|
||||||
|
$debugBar = $container->get('debugbar');
|
||||||
|
|
||||||
|
$debugBar->addCollector(new SmartyCollector($view->getSmarty()));
|
||||||
|
|
||||||
$view->offsetSet(
|
$view->offsetSet(
|
||||||
'debug_render',
|
'debug_render',
|
||||||
$container->get('debugbar')
|
$debugBar->getJavascriptRenderer(
|
||||||
->getJavascriptRenderer($uri->getBaseUrl() . '/vendor/maximebf/debugbar/src/DebugBar/Resources/')
|
$uri->getBaseUrl() . '/vendor/maximebf/debugbar/src/DebugBar/Resources/'
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,6 +44,7 @@
|
||||||
"enlightn/security-checker": "^1.4",
|
"enlightn/security-checker": "^1.4",
|
||||||
"ergebnis/composer-normalize": "^2.6",
|
"ergebnis/composer-normalize": "^2.6",
|
||||||
"insite/composer-dangling-locked-deps": "^0.2.1",
|
"insite/composer-dangling-locked-deps": "^0.2.1",
|
||||||
|
"junker/debugbar-smarty": "dev-master",
|
||||||
"maximebf/debugbar": "^1.16",
|
"maximebf/debugbar": "^1.16",
|
||||||
"php-mock/php-mock-mockery": "^1.3",
|
"php-mock/php-mock-mockery": "^1.3",
|
||||||
"phpro/grumphp": "^1.1",
|
"phpro/grumphp": "^1.1",
|
||||||
|
|
45
composer.lock
generated
45
composer.lock
generated
|
@ -4,7 +4,7 @@
|
||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "8f0982143c6c873f68d41017e195387a",
|
"content-hash": "ce151882c06d9b14d20fee47cb22be42",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "aura/session",
|
"name": "aura/session",
|
||||||
|
@ -3999,6 +3999,45 @@
|
||||||
"description": "Detect dangling Composer locked dependencies",
|
"description": "Detect dangling Composer locked dependencies",
|
||||||
"time": "2020-11-16T13:45:00+00:00"
|
"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",
|
"name": "justinrainbow/json-schema",
|
||||||
"version": "5.2.10",
|
"version": "5.2.10",
|
||||||
|
@ -7064,7 +7103,9 @@
|
||||||
],
|
],
|
||||||
"aliases": [],
|
"aliases": [],
|
||||||
"minimum-stability": "stable",
|
"minimum-stability": "stable",
|
||||||
"stability-flags": [],
|
"stability-flags": {
|
||||||
|
"junker/debugbar-smarty": 20
|
||||||
|
},
|
||||||
"prefer-stable": false,
|
"prefer-stable": false,
|
||||||
"prefer-lowest": false,
|
"prefer-lowest": false,
|
||||||
"platform": {
|
"platform": {
|
||||||
|
|
Loading…
Reference in a new issue