1
0
mirror of https://github.com/maximebf/php-debugbar.git synced 2025-01-17 05:18:32 +01:00
php-debugbar/demo/demo.php
2013-06-08 01:32:10 +07:00

47 lines
1.3 KiB
PHP

<?php
include 'bootstrap.php';
$debugbar['messages']->addMessage('hello');
$debugbar['time']->startMeasure('op1', 'sleep 500');
usleep(300);
$debugbar['time']->startMeasure('op2', 'sleep 400');
usleep(200);
$debugbar['time']->stopMeasure('op1');
usleep(200);
$debugbar['time']->stopMeasure('op2');
$debugbar['messages']->addMessage('world', 'warn');
$debugbar['messages']->addMessage(array('toto' => array('titi', 'tata')));
$debugbar['messages']->addMessage('oups', 'error');
$debugbar['time']->startMeasure('render');
?>
<html>
<head>
<?php echo $debugbarRenderer->renderIncludes() ?>
<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>
<p>PhpDebugBar Demo</p>
<p><a href="demo_ajax.php" class="ajax">load ajax content</a></p>
<p><a href="demo_ajax_exception.php" class="ajax">load ajax content with exception</a></p>
<?php
usleep(100);
$debugbar->collect();
echo $debugbarRenderer->renderToolbar();
?>
</body>
</html>