1
0
mirror of https://github.com/maximebf/php-debugbar.git synced 2025-01-17 21:38:14 +01:00
php-debugbar/demo/bootstrap.php

52 lines
1.4 KiB
PHP
Raw Normal View History

2013-06-08 01:32:10 +07:00
<?php
include __DIR__ . '/../vendor/autoload.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();
$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
2014-01-16 21:41:41 +00:00
//
// $debugbar->setStorage(new DebugBar\Storage\FileStorage(__DIR__ . '/profiles'));
// $debugbar->setStorage(new DebugBar\Storage\RedisStorage(new Predis\Client()));
// $debugbarRenderer->setOpenHandlerUrl('open.php');
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
2014-01-16 21:41:41 +00:00
}