Skip to content

Commit

Permalink
Merge 7596fc8 into 99c87de
Browse files Browse the repository at this point in the history
  • Loading branch information
EvilKraft committed Dec 28, 2018
2 parents 99c87de + 7596fc8 commit 1f3b274
Show file tree
Hide file tree
Showing 17 changed files with 54 additions and 35 deletions.
7 changes: 6 additions & 1 deletion .travis.yml
Expand Up @@ -6,7 +6,12 @@ php:
- 5.6
- 7.0
- 7.1
- hhvm
- 7.2
- nightly

matrix:
allow_failures:
- php: nightly

before_script:
- composer install --no-suggest ;
Expand Down
1 change: 1 addition & 0 deletions Example/Settings.php
Expand Up @@ -127,6 +127,7 @@
'ConsoleTerminalJs' => '/assets/js/jquery.terminal.min.js',
// terminal.css full URI
'ConsoleTerminalCss' => '/assets/css/jquery.terminal.min.css',
'ConsoleFromEncoding' => 'CP866', // or false
'ProfilerPanel' => [
// Memory usage 'primaryValue' set as Profiler::enable() or Profiler::enable(1)
// 'primaryValue' => 'effective', // or 'absolute'
Expand Down
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -183,6 +183,7 @@ return [
'ConsoleTerminalJs' => '/assets/js/jquery.terminal.min.js',
// terminal.css full URI
'ConsoleTerminalCss' => '/assets/css/jquery.terminal.min.css',
'ConsoleFromEncoding' => 'CP866', // or false
'ProfilerPanel' => [
// Memory usage 'primaryValue' set as Profiler::enable() or Profiler::enable(1)
// 'primaryValue' => 'effective', // or 'absolute'
Expand Down
6 changes: 6 additions & 0 deletions src/RunTracy/Controllers/RunTracyConsole.php
Expand Up @@ -44,6 +44,12 @@ public function index(Request $request, Response $response)
$this->passwordHashAlgorithm = $cfg['ConsoleHashAlgorithm'] ?: '';
$this->homeDirectory = $cfg['ConsoleHomeDirectory'] ?: '';

$ConsoleResponce = $this->execute();

if($cfg['ConsoleFromEncoding']){
$ConsoleResponce['result']['output'] = mb_convert_encoding($ConsoleResponce['result']['output'], "UTF-8", $cfg['ConsoleFromEncoding']);
}

return $response->withJson($this->execute());
}
}
2 changes: 1 addition & 1 deletion src/RunTracy/Helpers/ConsolePanel.php
Expand Up @@ -65,7 +65,7 @@ function blinker() {

$this->icon = '
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" '.
'y="0px" width="16px" height="16px" viewBox="0 0 471.362 471.362" style="enable-background:new '.
'y="0px" width="16" height="16" viewBox="0 0 471.362 471.362" style="enable-background:new '.
'0 0 471.362 471.362;" xml:space="preserve"><g>
<path d="M468.794,355.171c-1.707-1.718-3.897-2.57-6.563-2.57H188.145c-2.664,0-4.854,0.853-6.567,2.57 '.
'c-1.711,1.711-2.565,3.897-2.565,6.563v18.274c0,2.662,0.854,4.853,2.565,6.563c1.713,1.712,3.903,2.57,'.
Expand Down
2 changes: 1 addition & 1 deletion src/RunTracy/Helpers/DoctrinePanel.php
Expand Up @@ -91,7 +91,7 @@ protected function parse($logs)
if (!isset($log['executionMS'])) {
continue;
}
$time = $log['executionMS'];
$time += $log['executionMS'];
$row = $baseRow;
$return .= sprintf(
$row,
Expand Down
4 changes: 2 additions & 2 deletions src/RunTracy/Helpers/EloquentORMPanel.php
Expand Up @@ -46,8 +46,8 @@ public function getTab()
{
$this->data = $this->parse($this->data);
$this->icon = '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" x="0px" y="0px"viewBox="0 0 284.207 '.
'284.207" style="enable-background:new 0 0 284.207 284.207;" xml:space="preserve" width="16px" height='.
'"16px"><path d="M239.604,45.447c0-25.909-41.916-45.447-97.5-45.447s-97.5,19.538-97.5,45.447v47.882c0,'.
'284.207" style="enable-background:new 0 0 284.207 284.207;" xml:space="preserve" width="16" height='.
'"16"><path d="M239.604,45.447c0-25.909-41.916-45.447-97.5-45.447s-97.5,19.538-97.5,45.447v47.882c0,'.
'6.217,2.419,12.064,6.854,17.365 c-3.84,0.328-6.854,3.543-6.854,7.468v47.882c0,6.217,2.419,12.065,6.855'.
',17.366c-3.84,0.328-6.855,3.543-6.855,7.468v47.881 c0,25.91,41.916,45.448,97.5,45.448s97.5-19.538,97.'.
'5-45.448v-47.881c0-3.925-3.016-7.14-6.855-7.468 c4.437-5.301,6.855-11.149,6.855-17.366v-47.882c0-3.'.
Expand Down
4 changes: 2 additions & 2 deletions src/RunTracy/Helpers/IncludedFiles.php
Expand Up @@ -35,8 +35,8 @@ protected function getBaseRow()

public function getTab()
{
$this->icon = '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" x="0px" y="0px" width="16px" '.
'height="16px" viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve">'.
$this->icon = '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" x="0px" y="0px" width="16" '.
'height="16" viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve">'.
'<g><path d="M506.195,307.084H5.805c-3.206,0-5.805,2.599-5.805,5.805V488.2c0,9.618,7.797,17.415,17.415,'.
'17.415h477.17 c9.618,0,17.415-7.797,17.415-17.415V312.889C512,309.683,509.401,307.084,506.195,307.'.
'084z M256,456.853 c-27.848,0-50.503-22.656-50.503-50.503c0-27.848,22.656-50.503,50.503-50.503s50.'.
Expand Down
2 changes: 1 addition & 1 deletion src/RunTracy/Helpers/PanelSelector.php
Expand Up @@ -39,7 +39,7 @@ public function __construct(array $cfg = [], array $defcfg = [])
public function getTab()
{
$this->icon = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" '.
'version="1.1" x="0px" y="0px" width="16px" height="16px" viewBox="0 0 369.793 369.792"style="'.
'version="1.1" x="0px" y="0px" width="16" height="16" viewBox="0 0 369.793 369.792" style="'.
'enable-background:new 0 0 369.793 369.792;" xml:space="preserve"><path d="M320.83,140.434l-1.'.
'759-0.627l-6.87-16.399l0.745-1.685c20.812-47.201,19.377-48.609,15.925-52.031L301.11,42.61 '.
'c-1.135-1.126-3.128-1.918-4.846-1.918c-1.562,0-6.293,0-47.294,18.57L247.326,60l-16.916-6.812l'.
Expand Down
4 changes: 2 additions & 2 deletions src/RunTracy/Helpers/PhpInfoPanel.php
Expand Up @@ -26,8 +26,8 @@ class PhpInfoPanel implements IBarPanel
public function getTab()
{
$this->icon = '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" x="0px" y="0px" viewBox="0 0 16.172 '.
'16.172" style="enable-background:new 0 0 16.172 16.172;" xml:space="preserve" width="16px" '.
'height="16px"><path d="M13.043,6.367c-0.237,0-0.398,0.022-0.483,0.047v1.523c0.101,0.022,0.223,0.03,'.
'16.172" style="enable-background:new 0 0 16.172 16.172;" xml:space="preserve" width="16" '.
'height="16"><path d="M13.043,6.367c-0.237,0-0.398,0.022-0.483,0.047v1.523c0.101,0.022,0.223,0.03,'.
'0.391,0.03 c0.621,0,1.004-0.313,1.004-0.842C13.954,6.651,13.625,6.367,13.043,6.367z" fill="#006DF0"/>'.
' <path d="M15.14,0H1.033C0.463,0,0,0.462,0,1.032v14.108c0,0.568,0.462,1.031,1.033,1.031H15.14 c0.57,'.
'0,1.032-0.463,1.032-1.031V1.032C16.172,0.462,15.71,0,15.14,0z M4.904,8.32C4.506,8.695,3.916,8.863,'.
Expand Down
4 changes: 2 additions & 2 deletions src/RunTracy/Helpers/SlimRequestPanel.php
Expand Up @@ -34,8 +34,8 @@ public function __construct($data = null, array $ver = [])

public function getTab()
{
$this->icon = '<svg enable-background="new 0 0 64 64" height="16px" version="1.1" viewBox="0 0 64 64" '.
'width="16px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org'.
$this->icon = '<svg enable-background="new 0 0 64 64" height="16" version="1.1" viewBox="0 0 64 64" '.
'width="16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org'.
'/1999/xlink"><g><circle cx="32" cy="32" fill="#77B3D4" r="32"/></g><g opacity="0.2"><path d="M49.529'.
',33.855L35.259,15.71c-1.793-2.28-4.726-2.28-6.519,0L14.471,33.855 C12.679,36.135,13.439,38,16.161,'.
'38H24v12c0,2.209,1.791,4,4,4h8c2.209,0,4-1.791,4-4V38h7.839 C50.561,38,51.321,36.135,49.529,33.855z"'.
Expand Down
4 changes: 2 additions & 2 deletions src/RunTracy/Helpers/SlimResponsePanel.php
Expand Up @@ -34,8 +34,8 @@ public function __construct($data = null, array $ver = [])

public function getTab()
{
$this->icon = '<svg enable-background="new 0 0 64 64" height="16px" version="1.1" viewBox="0 0 64 64" '.
'width="16px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><g id="Layer_1"><g><circle '.
$this->icon = '<svg enable-background="new 0 0 64 64" height="16" version="1.1" viewBox="0 0 64 64" '.
'width="16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><g id="Layer_1"><g><circle '.
'cx="32" cy="32" fill="#76C2AF" r="32"/></g><g opacity="0.2"><path d="M47.839,30H40V18c0-2.209-1.'.
'791-4-4-4h-8c-2.209,0-4,1.791-4,4v12h-7.839c-2.722,0-3.483,1.865-1.69,4.145 L28.741,52.29c1.'.
'793,2.28,4.726,2.28,6.519,0l14.269-18.146C51.321,31.865,50.561,30,47.839,30z" fill="#231F20"/>'.
Expand Down
4 changes: 2 additions & 2 deletions src/RunTracy/Helpers/SlimRouterPanel.php
Expand Up @@ -34,8 +34,8 @@ public function __construct($data = null, array $ver = [])

public function getTab()
{
$this->icon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 480 480" version="1.1" width="16px" '.
'height="16px"><path fill="#043CBF" d="m221.25 479.1c-79.88-6.85-150.37-51.83-189.99-121.24-14.666-'.
$this->icon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 480 480" version="1.1" width="16" '.
'height="16"><path fill="#043CBF" d="m221.25 479.1c-79.88-6.85-150.37-51.83-189.99-121.24-14.666-'.
'25.69-23.972-53.8-29.552-89.27-0.70825-4.5-1.1632-16.11-1.1384-29.06 0.04489-23.34 1.5027-35.94 6.5464'.
'-56.54 14.241-58.18 49.919-109.05 99.764-142.23 30.47-20.29 60.66-31.962 98.61-38.123 10.115-1.6422 '.
'16.564-2.0339 34.042-2.0675 12.945-0.024869 24.56 0.43011 29.062 1.1385 35.467 5.5797 63.58 14.886 '.
Expand Down
2 changes: 1 addition & 1 deletion src/RunTracy/Helpers/VendorVersionsPanel.php
Expand Up @@ -43,7 +43,7 @@ public function getTab()
{
return '
<span title="Vendor Versions">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 600 512" width="16px" height="16px">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 600 512" width="16" height="16">
<path fill="#478CCC" d="M489.349,131.258l0.47-0.462L374.228,15.515l-32.895,32.894l65.485,65.47c-29.'.
'182,11.174-49.97,39.258-49.97,72.303 c0,42.818,34.758,77.576,77.575,77.576c11.016,0,21.576-2.326,'.
'31.03-6.516V480.97c0,17.061-13.97,31.03-31.03,31.03 s-31.03-13.97-31.03-31.03V341.333c0-34.287-27.'.
Expand Down
32 changes: 16 additions & 16 deletions src/RunTracy/Middlewares/TracyMiddleware.php
Expand Up @@ -64,9 +64,9 @@ public function __invoke(Request $request, Response $response, callable $next)
$cookies = array_fill_keys($cookies, 1);
$cfg = array_merge($def, $cookies);
} else {
$cfg = [];
$cfg = $this->defcfg;
}
if (isset($cfg['showEloquentORMPanel'])) {
if (isset($cfg['showEloquentORMPanel']) && $cfg['showEloquentORMPanel']) {
if (class_exists('\Illuminate\Database\Capsule\Manager')) {
Debugger::getBar()->addPanel(new \RunTracy\Helpers\EloquentORMPanel(
\Illuminate\Database\Capsule\Manager::getQueryLog()
Expand All @@ -76,70 +76,70 @@ public function __invoke(Request $request, Response $response, callable $next)
unset($this->defcfg['showEloquentORMPanel']);
}
}
if (isset($cfg['showTwigPanel'])) {
if (isset($cfg['showTwigPanel']) && $cfg['showTwigPanel']) {
Debugger::getBar()->addPanel(new \RunTracy\Helpers\TwigPanel(
$this->container->get('twig_profile')
));
}
if (isset($cfg['showPhpInfoPanel'])) {
if (isset($cfg['showPhpInfoPanel']) && $cfg['showPhpInfoPanel']) {
Debugger::getBar()->addPanel(new \RunTracy\Helpers\PhpInfoPanel());
}
if (isset($cfg['showSlimEnvironmentPanel'])) {
if (isset($cfg['showSlimEnvironmentPanel']) && $cfg['showSlimEnvironmentPanel']) {
Debugger::getBar()->addPanel(new \RunTracy\Helpers\SlimEnvironmentPanel(
\Tracy\Dumper::toHtml($this->container->get('environment')),
$this->versions
));
}
if (isset($cfg['showSlimContainer'])) {
if (isset($cfg['showSlimContainer']) && $cfg['showSlimContainer']) {
Debugger::getBar()->addPanel(new \RunTracy\Helpers\SlimContainerPanel(
\Tracy\Dumper::toHtml($this->container),
$this->versions
));
}
if (isset($cfg['showSlimRouterPanel'])) {
if (isset($cfg['showSlimRouterPanel']) && $cfg['showSlimRouterPanel']) {
Debugger::getBar()->addPanel(new \RunTracy\Helpers\SlimRouterPanel(
\Tracy\Dumper::toHtml($this->container->get('router')),
$this->versions
));
}
if (isset($cfg['showSlimRequestPanel'])) {
if (isset($cfg['showSlimRequestPanel']) && $cfg['showSlimRequestPanel']) {
Debugger::getBar()->addPanel(new \RunTracy\Helpers\SlimRequestPanel(
\Tracy\Dumper::toHtml($this->container->get('request')),
$this->versions
));
}
if (isset($cfg['showSlimResponsePanel'])) {
if (isset($cfg['showSlimResponsePanel']) && $cfg['showSlimResponsePanel']) {
Debugger::getBar()->addPanel(new \RunTracy\Helpers\SlimResponsePanel(
\Tracy\Dumper::toHtml($this->container->get('response')),
$this->versions
));
}
if (isset($cfg['showVendorVersionsPanel'])) {
if (isset($cfg['showVendorVersionsPanel']) && $cfg['showVendorVersionsPanel']) {
Debugger::getBar()->addPanel(new \RunTracy\Helpers\VendorVersionsPanel());
}
if (isset($cfg['showXDebugHelper'])) {
if (isset($cfg['showXDebugHelper']) && $cfg['showXDebugHelper']) {
Debugger::getBar()->addPanel(new \RunTracy\Helpers\XDebugHelper(
$this->defcfg['configs']['XDebugHelperIDEKey']
));
}
if (isset($cfg['showIncludedFiles'])) {
if (isset($cfg['showIncludedFiles']) && $cfg['showIncludedFiles']) {
Debugger::getBar()->addPanel(new \RunTracy\Helpers\IncludedFiles());
}
// check if enabled or blink if active critical value
if (isset($cfg['showConsolePanel']) || $this->defcfg['configs']['ConsoleNoLogin']) {
if ((isset($cfg['showConsolePanel']) && $cfg['showConsolePanel']) || isset($cfg['configs']['ConsoleNoLogin']) && $cfg['configs']['ConsoleNoLogin']) {
Debugger::getBar()->addPanel(new \RunTracy\Helpers\ConsolePanel(
$this->defcfg['configs']
));
}
if (isset($cfg['showProfilerPanel'])) {
if (isset($cfg['showProfilerPanel']) && $cfg['showProfilerPanel']) {
Debugger::getBar()->addPanel(new \RunTracy\Helpers\ProfilerPanel(
$this->defcfg['configs']['ProfilerPanel']
));
}
if (isset($cfg['showIdiormPanel'])) {
if (isset($cfg['showIdiormPanel']) && $cfg['showIdiormPanel']) {
Debugger::getBar()->addPanel(new \RunTracy\Helpers\IdiormPanel());
}
if (isset($cfg['showDoctrinePanel'])) {
if (isset($cfg['showDoctrinePanel']) && $cfg['showDoctrinePanel']) {
if (class_exists('\Doctrine\DBAL\Connection') && $this->container->has('doctrineConfig')) {
Debugger::getBar()->addPanel(
new \RunTracy\Helpers\DoctrinePanel(
Expand Down
9 changes: 7 additions & 2 deletions src/RunTracy/Templates/VendorVersionsPanel.phtml
Expand Up @@ -2,8 +2,13 @@

use Tracy\Helpers;

function h($str) {
if (!function_exists('h')) {
/**
* Convenience method for htmlspecialchars.
*/
function h($str) {
return htmlspecialchars($str, ENT_QUOTES | ENT_HTML5, 'UTF-8');
}
}

/**
Expand Down Expand Up @@ -34,7 +39,7 @@ function h($str) {

<div class="tracy-inner">
<h1>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 600 512" width="16px" height="16px"><path fill="#478CCC" d="M489.349,131.258l0.47-0.462L374.228,15.515l-32.895,32.894l65.485,65.47c-29.182,11.174-49.97,39.258-49.97,72.303 c0,42.818,34.758,77.576,77.575,77.576c11.016,0,21.576-2.326,31.03-6.516V480.97c0,17.061-13.97,31.03-31.03,31.03 s-31.03-13.97-31.03-31.03V341.333c0-34.287-27.772-62.061-62.061-62.061h-31.03V62.061C310.303,27.772,282.53,0,248.242,0H62.061 C27.772,0,0,27.772,0,62.061v496.485h310.303V325.818h46.546V480.97c0,42.818,34.758,77.576,77.575,77.576 c42.818,0,77.576-34.758,77.576-77.576V186.182C512,164.772,503.303,145.379,489.349,131.258z M248.242,217.212H62.061V62.061 h186.182V217.212z M434.424,217.212c-17.061,0-31.03-13.962-31.03-31.03s13.97-31.03,31.03-31.03s31.03,13.962,31.03,31.03 S451.484,217.212,434.424,217.212z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 600 512" width="16" height="16"><path fill="#478CCC" d="M489.349,131.258l0.47-0.462L374.228,15.515l-32.895,32.894l65.485,65.47c-29.182,11.174-49.97,39.258-49.97,72.303 c0,42.818,34.758,77.576,77.575,77.576c11.016,0,21.576-2.326,31.03-6.516V480.97c0,17.061-13.97,31.03-31.03,31.03 s-31.03-13.97-31.03-31.03V341.333c0-34.287-27.772-62.061-62.061-62.061h-31.03V62.061C310.303,27.772,282.53,0,248.242,0H62.061 C27.772,0,0,27.772,0,62.061v496.485h310.303V325.818h46.546V480.97c0,42.818,34.758,77.576,77.575,77.576 c42.818,0,77.576-34.758,77.576-77.576V186.182C512,164.772,503.303,145.379,489.349,131.258z M248.242,217.212H62.061V62.061 h186.182V217.212z M434.424,217.212c-17.061,0-31.03-13.962-31.03-31.03s13.97-31.03,31.03-31.03s31.03,13.962,31.03,31.03 S451.484,217.212,434.424,217.212z"/></svg>
Vendor Versions
</h1>
<div class="milo-VendorVersionsPanel">
Expand Down
1 change: 1 addition & 0 deletions tests/Settings.php
Expand Up @@ -122,6 +122,7 @@
'ConsoleTerminalJs' => '/assets/js/jquery.terminal.min.js',
// terminal.css full URI
'ConsoleTerminalCss' => '/assets/css/jquery.terminal.min.css',
'ConsoleFromEncoding' => 'CP866', // or false
'ProfilerPanel' => [
// Memory usage 'primaryValue' set as Profiler::enable() or Profiler::enable(1)
// 'primaryValue' => 'effective', // or 'absolute'
Expand Down

0 comments on commit 1f3b274

Please sign in to comment.