2013-06-08 01:32:10 +07:00
|
|
|
<?php
|
|
|
|
|
2013-08-12 18:49:21 +10:00
|
|
|
include __DIR__ . '/../tests/bootstrap.php';
|
2013-06-08 01:32:10 +07:00
|
|
|
|
2013-09-15 12:56:08 -04:00
|
|
|
// for stack data
|
|
|
|
session_start();
|
|
|
|
|
2013-06-08 01:32:10 +07:00
|
|
|
use DebugBar\StandardDebugBar;
|
|
|
|
|
|
|
|
$debugbar = new StandardDebugBar();
|
2013-09-19 16:31:50 -04:00
|
|
|
$debugbarRenderer = $debugbar->getJavascriptRenderer()
|
|
|
|
->setBaseUrl('../src/DebugBar/Resources')
|
|
|
|
->setEnableJqueryNoConflict(false);
|
2013-08-12 18:49:21 +10:00
|
|
|
|
2013-08-14 16:01:07 +10:00
|
|
|
//
|
|
|
|
// create a writable profiles folder in the demo directory to uncomment the following lines
|
|
|
|
//
|
2013-09-23 10:41:54 -04:00
|
|
|
// $debugbar->setStorage(new DebugBar\Storage\FileStorage(__DIR__ . '/profiles'));
|
|
|
|
// $debugbar->setStorage(new DebugBar\Storage\RedisStorage(new Predis\Client()));
|
|
|
|
// $debugbarRenderer->setOpenHandlerUrl('open.php');
|
2013-08-13 21:02:47 +10:00
|
|
|
|
2013-08-12 18:49:21 +10:00
|
|
|
function render_demo_page(Closure $callback = null)
|
|
|
|
{
|
|
|
|
global $debugbarRenderer;
|
|
|
|
?>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<?php echo $debugbarRenderer->renderHead() ?>
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(function() {
|
|
|
|
$('.ajax').click(function() {
|
|
|
|
var container = $(this).parent().html('...');
|
|
|
|
$.get(this.href, function(data) {
|
|
|
|
container.html(data);
|
|
|
|
});
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<h1>DebugBar Demo</h1>
|
|
|
|
<p>DebugBar at the bottom of the page</p>
|
|
|
|
<?php if ($callback) $callback(); ?>
|
|
|
|
<?php
|
|
|
|
echo $debugbarRenderer->render();
|
|
|
|
?>
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
<?php
|
|
|
|
}
|