1
0
mirror of https://github.com/maximebf/php-debugbar.git synced 2025-06-08 15:15:59 +02:00
php-debugbar/demo/bootstrap.php
Barry vd. Heuvel ae1f47ca11
Dark Theme + Theme variables + UI tweaks (#703)
* Add option to set theme

* Replace colors with variables

* Use mask for icons

* Fix borders

* Use better variables

* Remove theme

* Add github dark

* Fix select

* Tweak open handler

* Fix inputs

* Fix toolbar

* Fix labels

* Add theme switcher

* Use :after for icons

* Slight tweak to base css

* Tweak restore btn

* Use font variables, tweak timeline

* TWeak openhandler

* Tweak query hover

* Remove openhandler padding

* Fix dataset switcher

* Tweak toolbar

* Move settings, simplify storage

* Add floating position and autoshow to settings

* Tweak constructor

* Add test

* Add hide empty tabs option

* Tweak loading

* Fix test

* Breathe a little

* Add screenshots to tests, test light/dark

* Run screenshot only on 8.4

* Tweak folder

* Tweak

* Rename var

* Twaek hover

* TWeak sql

* Tweak accent

* Fix overly fanatic rename

* Tweak to header
2025-01-26 15:41:20 +01:00

54 lines
1.6 KiB
PHP

<?php
include __DIR__ . '/../vendor/autoload.php';
// for stack data
session_start();
use DebugBar\StandardDebugBar;
$debugbar = new StandardDebugBar();
$debugbarRenderer = $debugbar->getJavascriptRenderer()
->setBaseUrl('../src/DebugBar/Resources')
->setAjaxHandlerEnableTab(true)
->setHideEmptyTabs(true)
->setEnableJqueryNoConflict(false)
->setTheme($_GET['theme'] ?? 'auto');
//
// create a writable profiles folder in the demo directory to uncomment the following lines
//
// $debugbar->setStorage(new DebugBar\Storage\FileStorage(__DIR__ . '/profiles'));
// $debugbar->setStorage(new DebugBar\Storage\RedisStorage(new Predis\Client()));
// $debugbarRenderer->setOpenHandlerUrl('open.php');
function render_demo_page(?Closure $callback = null)
{
global $debugbarRenderer;
?>
<html>
<head>
<?php echo $debugbarRenderer->renderHead() ?>
<script type="text/javascript">
$(function() {
$('.ajax').click(function() {
$.get(this.href, function(data) {
$('#ajax-result').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
}