Skip to content
Permalink
Browse files

Added Tracy, enabled if LEAFPUB_DEV == 1

  • Loading branch information...
karsasmus committed May 19, 2017
1 parent 2dd53d2 commit f5c8643026a16058f05ac16347ddba3337dc8781
Showing with 200 additions and 2 deletions.
  1. +47 −0 app/index.php
  2. +12 −0 app/source/classes/Middleware.php
  3. +4 −0 app/source/config/middleware.php
  4. +3 −1 composer.json
  5. +134 −1 composer.lock
@@ -17,6 +17,53 @@
$container = new \Slim\Container();
if (LEAFPUB_DEV){
$container['settings']['displayErrorDetails'] = true;
$container['settings']['tracy'] = [
'showPhpInfoPanel' => 1,
'showSlimRouterPanel' => 1,
'showSlimEnvironmentPanel' => 1,
'showSlimRequestPanel' => 1,
'showSlimResponsePanel' => 1,
'showSlimContainer' => 1,
'showEloquentORMPanel' => 0,
'showTwigPanel' => 0,
'showIdiormPanel' => 0,// > 0 mean you enable logging
// but show or not panel you decide in browser in panel selector
'showDoctrinePanel' => 'em',// here also enable logging and you must enter your Doctrine container name
// and also as above show or not panel you decide in browser in panel selector
'showProfilerPanel' => 1,
'showVendorVersionsPanel' => 1,
'showXDebugHelper' => 0,
'showIncludedFiles' => 1,
'showConsolePanel' => 0,
'configs' => [
// XDebugger IDE key
'XDebugHelperIDEKey' => 'PHPSTORM',
// Disable login (don't ask for credentials, be careful) values( 1 || 0 )
'ConsoleNoLogin' => 0,
// Multi-user credentials values( ['user1' => 'password1', 'user2' => 'password2'] )
'ConsoleAccounts' => [
'dev' => '34c6fceca75e456f25e7e99531e2425c6c1de443'// = sha1('dev')
],
// Password hash algorithm (password must be hashed) values('md5', 'sha256' ...)
'ConsoleHashAlgorithm' => 'sha1',
// Home directory (multi-user mode supported) values ( var || array )
// '' || '/tmp' || ['user1' => '/home/user1', 'user2' => '/home/user2']
'ConsoleHomeDirectory' => DIR,
// terminal.js full URI
'ConsoleTerminalJs' => '/assets/js/jquery.terminal.min.js',
// terminal.css full URI
'ConsoleTerminalCss' => '/assets/css/jquery.terminal.min.css',
'ProfilerPanel' => [
// Memory usage 'primaryValue' set as Profiler::enable() or Profiler::enable(1)
'primaryValue' => 'absolute', // or 'absolute'
'show' => [
'memoryUsageChart' => 1, // or false
'shortProfiles' => true, // or false
'timeLines' => true // or false
]
]
]
];
}
$app = new \Slim\App($container);
@@ -242,4 +242,16 @@ public function imageMiddleware($request, $response, $next){
return $next($request, $response);
}
public function tracy($request, $response, $next){
if (LEAFPUB_DEV){
\Tracy\Debugger::enable();
//\Tracy\Debugger::getBar()->addPanel(new \Zarganwar\PerformancePanel\Panel(), "PerformancePanel");
if ($request->getParsedBody()) {
\Tracy\Debugger::barDump($request->getParsedBody(), 'ParsedBody');
}
$response = $next($request, $response);
return $response;
}
}
}
@@ -5,4 +5,8 @@
$app->add('Leafpub\Middleware:maintenance');
$app->add('Leafpub\Middleware:updateRegister');
$app->add('Leafpub\Middleware:imageMiddleware');
if (LEAFPUB_DEV){
$app->add(new \RunTracy\Middlewares\TracyMiddleware($app));
$app->add('Leafpub\Middleware:tracy');
}
?>
@@ -16,7 +16,9 @@
"symfony/event-dispatcher": "^3.1",
"composer/semver": "^1.4.2",
"zendframework/zend-db": "^2.7",
"monolog/monolog": "^1.0"
"monolog/monolog": "^1.0",
"tracy/tracy": "^2.4",
"runcmf/runtracy": "^0.2.9"
},
"config": {
"vendor-dir": "app/source/vendor"

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit f5c8643

Please sign in to comment.
You can’t perform that action at this time.