1
0
mirror of https://github.com/maximebf/php-debugbar.git synced 2025-05-06 15:05:17 +02:00

Merge branch 'master' into feat-openhandler-actionable

This commit is contained in:
Barry vd. Heuvel 2025-01-26 16:37:10 +01:00
commit 534cd4397a
39 changed files with 1633 additions and 275 deletions

@ -19,7 +19,7 @@ jobs:
strategy:
matrix:
php: [8.4, 8.3, 8.2, 8.1, 8.0, 7.4, 7.3, 7.2]
php: [8.4, 8.3, 8.2, 8.1, 8.0]
name: PHP${{ matrix.php }}

51
.github/workflows/run-screenshots.yml vendored Normal file

@ -0,0 +1,51 @@
name: Screenshots
on:
push:
branches:
- master
pull_request:
branches:
- "*"
schedule:
- cron: '0 0 * * *'
jobs:
php-tests:
runs-on: ubuntu-latest
timeout-minutes: 15
env:
COMPOSER_NO_INTERACTION: 1
strategy:
matrix:
php: [8.4]
name: PHP${{ matrix.php }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
extensions: pdo_sqlite
- name: Install dependencies
run: |
composer update --prefer-dist --no-progress
composer update --prefer-dist --no-progress --working-dir=demo/bridge/monolog
composer update --prefer-dist --no-progress --working-dir=demo/bridge/doctrine
composer run --working-dir=demo/bridge/doctrine install-schema
- name: Execute Unit Tests
run: vendor/bin/phpunit --testsuite=Browser
- name: Upload screenshots
uses: actions/upload-artifact@v4
with:
name: debugbar-screenshots
path: tests/screenshots

@ -19,7 +19,7 @@ jobs:
strategy:
matrix:
php: [8.4, 8.3, 8.2, 8.1, 8.0, 7.4, 7.3, 7.2]
php: [8.4, 8.3, 8.2, 8.1, 8.0]
name: PHP${{ matrix.php }}
@ -38,4 +38,4 @@ jobs:
run: composer update --prefer-dist --no-progress
- name: Execute Unit Tests
run: vendor/bin/phpunit --testsuite=Unit
run: vendor/bin/phpunit --testsuite=Unit

3
.gitignore vendored

@ -2,7 +2,10 @@ composer.lock
/vendor
/demo/bridge/*/vendor
/demo/bridge/doctrine/db.sqlite
/demo/profiles
/src/DebugBar/Resources/vendor
.phpunit.result.cache
/drivers
/chromedriver
.phpunit.cache/
/tests/screenshots

@ -5,6 +5,8 @@
Displays a debug bar in the browser with information from php.
No more `var_dump()` in your code!
> **Note: Debug Bar is for development use only. Never install this on websites that are publicly accessible.**
![Screenshot](https://raw.github.com/maximebf/php-debugbar/master/docs/screenshot.png)
**Features:**
@ -57,7 +59,9 @@ Integrations with other frameworks:
The best way to install DebugBar is using [Composer](http://getcomposer.org)
with the following command:
```composer require maximebf/debugbar```
```bash
composer require maximebf/debugbar --dev
```
## Quick start

Binary file not shown.

@ -1,8 +1,8 @@
{
"name": "maximebf/debugbar",
"name": "php-debugbar/php-debugbar",
"description": "Debug bar in the browser for php application",
"keywords": ["debug", "debugbar"],
"homepage": "https://github.com/maximebf/php-debugbar",
"keywords": ["debug", "debugbar", "debug bar", "dev"],
"homepage": "https://github.com/php-debugbar/php-debugbar",
"type": "library",
"license": "MIT",
"authors": [
@ -17,7 +17,7 @@
}
],
"require": {
"php": "^7.2|^8",
"php": "^8",
"psr/log": "^1|^2|^3",
"symfony/var-dumper": "^4|^5|^6|^7"
},
@ -56,7 +56,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "1.22-dev"
"dev-master": "2.0-dev"
}
}
}

@ -11,7 +11,9 @@ $debugbar = new StandardDebugBar();
$debugbarRenderer = $debugbar->getJavascriptRenderer()
->setBaseUrl('../src/DebugBar/Resources')
->setAjaxHandlerEnableTab(true)
->setEnableJqueryNoConflict(false);
->setHideEmptyTabs(true)
->setEnableJqueryNoConflict(false)
->setTheme($_GET['theme'] ?? 'auto');
//
// create a writable profiles folder in the demo directory to uncomment the following lines
@ -20,7 +22,7 @@ $debugbarRenderer = $debugbar->getJavascriptRenderer()
// $debugbar->setStorage(new DebugBar\Storage\RedisStorage(new Predis\Client()));
// $debugbarRenderer->setOpenHandlerUrl('open.php');
function render_demo_page(Closure $callback = null)
function render_demo_page(?Closure $callback = null)
{
global $debugbarRenderer;
?>

@ -11,9 +11,10 @@ $debugbar->addCollector(new DebugBar\Bridge\DoctrineCollector($debugStack));
$product = new Demo\Product();
$product->setName("foobar");
$product->setUpdated();
$entityManager->persist($product);
$entityManager->flush();
$entityManager->createQuery("select p from Demo\\Product p where p.updated>:u")->setParameter("u", new \DateTime('1 hour ago'))->execute();
$entityManager->createQuery("select p from Demo\\Product p where p.name=:c")->setParameter("c", "<script>alert();</script>")->execute();
render_demo_page();

@ -11,6 +11,8 @@ class Product
protected $id;
/** @Column(type="string") **/
protected $name;
/** @Column(type="datetime", nullable=true) **/
protected $updated;
public function getId()
{
@ -26,4 +28,10 @@ class Product
{
$this->name = $name;
}
public function setUpdated(): void
{
// will NOT be saved in the database
$this->updated = new \DateTime('now');
}
}

@ -38,7 +38,7 @@ class CacheCacheCollector extends MonologCollector
* @param bool $level
* @param bool $bubble
*/
public function __construct(Cache $cache = null, Logger $logger = null, $level = Logger::DEBUG, $bubble = true)
public function __construct(?Cache $cache = null, ?Logger $logger = null, $level = Logger::DEBUG, $bubble = true)
{
parent::__construct(null, $level, $bubble);

@ -60,7 +60,7 @@ class DoctrineCollector extends DataCollector implements Renderable, AssetProvid
foreach ($this->debugStack->queries as $q) {
$queries[] = array(
'sql' => $q['sql'],
'params' => (object) $this->getParameters($q),
'params' => (object) $this->getParameters($q['params'] ?? []),
'duration' => $q['executionMS'],
'duration_str' => $this->formatDuration($q['executionMS'])
);
@ -80,13 +80,22 @@ class DoctrineCollector extends DataCollector implements Renderable, AssetProvid
*
* @return array
*/
public function getParameters($query) : array
public function getParameters($params) : array
{
$params = [];
foreach ($query['params'] ?? [] as $name => $param) {
$params[$name] = htmlentities($param?:"", ENT_QUOTES, 'UTF-8', false);
}
return $params;
return array_map(function ($param) {
if (is_string($param)) {
return htmlentities($param, ENT_QUOTES, 'UTF-8', false);
} elseif (is_array($param)) {
return '[' . implode(', ', $this->getParameters($param)) . ']';
} elseif (is_numeric($param)) {
return strval($param);
} elseif ($param instanceof \DateTimeInterface) {
return $param->format('Y-m-d H:i:s');
} elseif (is_object($param)) {
return json_encode($param);
}
return $param ?: '';
}, $params);
}
/**

@ -37,7 +37,7 @@ class MonologCollector extends AbstractProcessingHandler implements DataCollecto
* @param boolean $bubble
* @param string $name
*/
public function __construct(Logger $logger = null, $level = Logger::DEBUG, $bubble = true, $name = 'monolog')
public function __construct(?Logger $logger = null, $level = Logger::DEBUG, $bubble = true, $name = 'monolog')
{
parent::__construct($level, $bubble);
$this->name = $name;

@ -49,7 +49,7 @@ class PropelCollector extends DataCollector implements BasicLogger, Renderable,
*
* @param PropelConfiguration $config Apply profiling on a specific config
*/
public static function enablePropelProfiling(PropelConfiguration $config = null)
public static function enablePropelProfiling(?PropelConfiguration $config = null)
{
if ($config === null) {
$config = Propel::getConfiguration(PropelConfiguration::TYPE_OBJECT);
@ -74,7 +74,7 @@ class PropelCollector extends DataCollector implements BasicLogger, Renderable,
* @param LoggerInterface $logger A logger to forward non-query log lines to
* @param PropelPDO $conn Bound this collector to a connection only
*/
public function __construct(LoggerInterface $logger = null, PropelPDO $conn = null)
public function __construct(?LoggerInterface $logger = null, ?PropelPDO $conn = null)
{
if ($conn) {
$conn->setLogger($this);

@ -36,7 +36,7 @@ class TimeableTwigExtensionProfiler extends ProfilerExtension
$this->timeDataCollector = $timeDataCollector;
}
public function __construct(Profile $profile, TimeDataCollector $timeDataCollector = null)
public function __construct(Profile $profile, ?TimeDataCollector $timeDataCollector = null)
{
parent::__construct($profile);

@ -24,7 +24,7 @@ use Twig_TokenStream;
/**
* Wrapped a Twig Environment to provide profiling features
*
*
* @deprecated
*/
class TraceableTwigEnvironment extends Twig_Environment
@ -39,7 +39,7 @@ class TraceableTwigEnvironment extends Twig_Environment
* @param Twig_Environment $twig
* @param TimeDataCollector $timeDataCollector
*/
public function __construct(Twig_Environment $twig, TimeDataCollector $timeDataCollector = null)
public function __construct(Twig_Environment $twig, ?TimeDataCollector $timeDataCollector = null)
{
$this->twig = $twig;
$this->timeDataCollector = $timeDataCollector;

@ -97,11 +97,22 @@ class ExceptionsCollector extends DataCollector implements Renderable
if (isset($track['file'])) {
$track['file'] = $this->normalizeFilePath($track['file']);
}
return $track;
}, $trace);
}
// Remove large objects from the trace
$trace = array_map(function ($track) {
if (isset($track['args'])) {
foreach ($track['args'] as $key => $arg) {
if (is_object($arg)) {
$track['args'][$key] = '[object ' . $this->getDataFormatter()->formatClassName($arg) . ']';
}
}
}
return $track;
}, $trace);
return $trace;
}

@ -26,7 +26,7 @@ class PDOCollector extends DataCollector implements Renderable, AssetProvider
* @param \PDO $pdo
* @param TimeDataCollector $timeCollector
*/
public function __construct(\PDO $pdo = null, TimeDataCollector $timeCollector = null)
public function __construct(?\PDO $pdo = null, ?TimeDataCollector $timeCollector = null)
{
$this->timeCollector = $timeCollector;
if ($pdo !== null) {
@ -138,7 +138,7 @@ class PDOCollector extends DataCollector implements Renderable, AssetProvider
* @param string|null $connectionName the pdo connection (eg default | read | write)
* @return array
*/
protected function collectPDO(TraceablePDO $pdo, TimeDataCollector $timeCollector = null, $connectionName = null)
protected function collectPDO(TraceablePDO $pdo, ?TimeDataCollector $timeCollector = null, $connectionName = null)
{
if (empty($connectionName) || $connectionName == 'default') {
$connectionName = 'pdo';

@ -57,7 +57,7 @@ class TracedStatement
* @param float $endTime
* @param int $endMemory
*/
public function end(\Exception $exception = null, int $rowCount = 0, float $endTime = null, int $endMemory = null) : void
public function end(?\Exception $exception = null, int $rowCount = 0, ?float $endTime = null, ?int $endMemory = null) : void
{
$this->endTime = $endTime ?: microtime(true);
$this->duration = $this->endTime - $this->startTime;

@ -120,11 +120,12 @@ trait HasXdebugLinks
'vscode-remote' => 'vscode://vscode-remote/%f:%l',
'vscode-insiders-remote' => 'vscode-insiders://vscode-remote/%f:%l',
'vscodium' => 'vscodium://file/%f:%l',
'nova' => 'nova://core/open/file?filename=%f&line=%l',
'nova' => 'nova://open?path=%f&line=%l',
'xdebug' => 'xdebug://%f@%l',
'atom' => 'atom://core/open/file?filename=%f&line=%l',
'espresso' => 'x-espresso://open?filepath=%f&lines=%l',
'netbeans' => 'netbeans://open/?f=%f:%l',
'cursor' => 'cursor://file/%f:%l',
);
if (is_string($editor) && isset($editorLinkTemplates[$editor])) {

@ -148,7 +148,7 @@ class DebugBar implements ArrayAccess
* @param StorageInterface $storage
* @return $this
*/
public function setStorage(StorageInterface $storage = null)
public function setStorage(?StorageInterface $storage = null)
{
$this->storage = $storage;
return $this;

@ -62,6 +62,10 @@ class JavascriptRenderer
protected $useRequireJs = false;
protected $theme = null;
protected $hideEmptyTabs = null;
protected $initialization;
protected $controls = array();
@ -157,6 +161,12 @@ class JavascriptRenderer
if (array_key_exists('use_requirejs', $options)) {
$this->setUseRequireJs($options['use_requirejs']);
}
if (array_key_exists('theme', $options)) {
$this->setTheme($options['theme']);
}
if (array_key_exists('hide_empty_tabs', $options)) {
$this->setHideEmptyTabs($options['hide_empty_tabs']);
}
if (array_key_exists('controls', $options)) {
foreach ($options['controls'] as $name => $control) {
$this->addControl($name, $control);
@ -397,6 +407,40 @@ class JavascriptRenderer
return $this->useRequireJs;
}
/**
* Sets the default theme
*
* @param boolean $hide
* @return $this
*/
public function setTheme($theme='auto')
{
$this->theme = $theme;
return $this;
}
/**
* Sets whether to hide empty tabs or not
*
* @param boolean $hide
* @return $this
*/
public function setHideEmptyTabs($hide = true)
{
$this->hideEmptyTabs = $hide;
return $this;
}
/**
* Checks if empty tabs are hidden or not
*
* @return boolean
*/
public function areEmptyTabsHidden()
{
return $this->hideEmptyTabs;
}
/**
* Adds a control to initialize
*
@ -1036,7 +1080,7 @@ class JavascriptRenderer
public function replaceTagInBuffer($here = true, $initialize = true, $renderStackedData = true, $head = false)
{
$render = ($head ? $this->renderHead() : "")
. $this->render($initialize, $renderStackedData);
. $this->render($initialize, $renderStackedData);
$current = ($here && ob_get_level() > 0) ? ob_get_clean() : self::REPLACEABLE_TAG;
@ -1075,7 +1119,7 @@ class JavascriptRenderer
$nonce = $this->getNonceAttribute();
if ($nonce != '') {
if ($nonce != '') {
$js = preg_replace("/<script>/", "<script nonce='{$this->cspNonce}'>", $js);
}
@ -1097,7 +1141,8 @@ class JavascriptRenderer
$js = '';
if (($this->initialization & self::INITIALIZE_CONSTRUCTOR) === self::INITIALIZE_CONSTRUCTOR) {
$js .= sprintf("var %s = new %s();\n", $this->variableName, $this->javascriptClass);
$initializeOptions = $this->getInitializeOptions();
$js .= sprintf("var %s = new %s(%s);\n", $this->variableName, $this->javascriptClass, $initializeOptions ? json_encode((object) $initializeOptions) : '');
}
if (($this->initialization & self::INITIALIZE_CONTROLS) === self::INITIALIZE_CONTROLS) {
@ -1130,6 +1175,21 @@ class JavascriptRenderer
return $js;
}
protected function getInitializeOptions()
{
$options = [];
if ($this->theme !== null) {
$options['theme'] = $this->theme;
}
if ($this->hideEmptyTabs !== null) {
$options['hideEmptyTabs'] = $this->hideEmptyTabs;
}
return $options;
}
/**
* Returns the js code needed to initialized the controls and data mapping of the debug bar
*

@ -5,23 +5,112 @@
}
}
div.phpdebugbar,
div.phpdebugbar-openhandler {
--debugbar-background: #fff;
--debugbar-background-alt: #fafafa;
--debugbar-text: #222;
--debugbar-text-muted: #888;
--debugbar-border: #eee;
--debugbar-header: #efefef;
--debugbar-header-text: #555;
--debugbar-header-border: #ddd;
--debugbar-active: #ccc;
--debugbar-active-text: #666;
--debugbar-icons: #555;
--debugbar-badge: #ccc;
--debugbar-badge-text: #555;
--debugbar-badge-active: #555;
--debugbar-badge-active-text: #fff;
--debugbar-link: #888;
--debugbar-hover: #aaa;
--debugbar-accent: #6BB7D8;
--debugbar-accent-border: #477e96;
--debugbar-font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
--debugbar-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
div.phpdebugbar[data-theme='dark'],
div.phpdebugbar-openhandler[data-theme='dark'] {
--debugbar-background: #2a2a2a;
--debugbar-background-alt: #333333;
--debugbar-text: #e0e0e0;
--debugbar-text-muted: #aaaaaa;
--debugbar-border: #3a3a3a;
--debugbar-header: #1e1e1e;
--debugbar-header-text: #cccccc;
--debugbar-header-border: #444;
--debugbar-active: #444;
--debugbar-active-text: #e0e0e0;
--debugbar-icons: #cccccc;
--debugbar-badge: #444;
--debugbar-badge-text: #cccccc;
--debugbar-badge-active: #cccccc;
--debugbar-badge-active-text: #1e1e1e;
--debugbar-accent: #4F8FB3;
--debugbar-accent-border: #3F7A94;
--debugbar-link: #aaaaaa;
--debugbar-hover: #888888;
}
div.phpdebugbar {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
border-top: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif;
background: #fff;
font-family: var(--debugbar-font-sans);
background: var(--debugbar-background);
z-index: 10000;
font-size: 14px;
color: #000;
color: var(--debugbar-text);
text-align: left;
line-height: 1;
line-height: 1.2em;
letter-spacing: normal;
direction: ltr;
}
div.phpdebugbar[data-openBtnPosition="bottomRight"].phpdebugbar-closed,
div.phpdebugbar[data-openBtnPosition="topRight"].phpdebugbar-closed {
left:auto;
right: 0;
}
div.phpdebugbar[data-openBtnPosition="topRight"].phpdebugbar-closed,
div.phpdebugbar[data-openBtnPosition="topLeft"].phpdebugbar-closed {
bottom:auto;
top: 0;
border-bottom: 1px solid var(--debugbar-header-border);
}
div.phpdebugbar[data-openBtnPosition="bottomRight"].phpdebugbar-closed,
div.phpdebugbar[data-openBtnPosition="bottomLeft"].phpdebugbar-closed {
border-top: 1px solid var(--debugbar-header-border);
}
.phpdebugbar-closed[data-openBtnPosition="bottomLeft"],
.phpdebugbar-closed[data-openBtnPosition="topLeft"] {
border-right: 1px solid var(--debugbar-header-border);
}
.phpdebugbar-closed[data-openBtnPosition="bottomRight"],
.phpdebugbar-closed[data-openBtnPosition="topRight"] {
border-left: 1px solid var(--debugbar-header-border);
}
div.phpdebugbar a,
div.phpdebugbar-openhandler {
cursor: pointer;
@ -51,6 +140,8 @@ div.phpdebugbar * {
text-decoration: none;
clear: initial;
width: auto;
direction: ltr;
text-align: left;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
@ -69,27 +160,28 @@ div.phpdebugbar table, .phpdebugbar-openhandler table {
color: inherit;
}
div.phpdebugbar input[type='text'], div.phpdebugbar input[type='password'] {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif;
background: #fff;
div.phpdebugbar input[type='text'], div.phpdebugbar input[type='password'], div.phpdebugbar select {
font-family: var(--debugbar-font-sans);
background: var(--debugbar-background);
font-size: 14px;
color: #000;
border: 0;
color: var(--debugbar-text);
padding: 0;
border: 1px solid var(--debugbar-border);
border-radius: 0.25rem;
margin: 0;
}
div.phpdebugbar code, div.phpdebugbar pre, div.phpdebugbar samp {
background: none;
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
font-family: var(--debugbar-font-mono);
font-size: 1em;
border: 0;
border: 0 !important;
padding: 0;
margin: 0;
}
div.phpdebugbar code, div.phpdebugbar pre {
color: #000;
color: var(--debugbar-text);
}
div.phpdebugbar pre.sf-dump {
@ -101,9 +193,8 @@ a.phpdebugbar-restore-btn {
float: left;
padding: 5px 8px;
font-size: 14px;
color: #555;
color: var(--debugbar-icons);
text-decoration: none;
border-right: 1px solid #ddd;
}
div.phpdebugbar-resize-handle {
@ -112,20 +203,22 @@ div.phpdebugbar-resize-handle {
margin-top: -4px;
width: 100%;
background: none;
border-bottom: 1px solid #ccc;
border-bottom: 1px solid var(--debugbar-header-border);
cursor: ns-resize;
}
div.phpdebugbar-closed, div.phpdebugbar-minimized{
border-top: 1px solid #ccc;
div.phpdebugbar-minimized{
border-top: 1px solid var(--debugbar-header-border);
}
/* -------------------------------------- */
a.phpdebugbar-restore-btn {
background: #efefef url(data:image/svg+xml,%3Csvg%20viewBox%3D%220%200%2020%2020%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Ccircle%20fill%3D%22%23000%22%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%229%22%2F%3E%3Cpath%20d%3D%22M6.039%208.342c.463%200%20.772.084.927.251.154.168.191.455.11.862-.084.424-.247.727-.487.908-.241.182-.608.272-1.1.272h-.743l.456-2.293h.837zm-2.975%204.615h1.22l.29-1.457H5.62c.461%200%20.84-.047%201.139-.142.298-.095.569-.254.812-.477.205-.184.37-.387.497-.608.127-.222.217-.466.27-.734.13-.65.032-1.155-.292-1.518-.324-.362-.84-.543-1.545-.543H4.153l-1.089%205.479zM9.235%206.02h1.21l-.289%201.458h1.079c.679%200%201.147.115%201.405.347.258.231.335.607.232%201.125l-.507%202.55h-1.23l.481-2.424c.055-.276.035-.464-.06-.565-.095-.1-.298-.15-.608-.15H9.98L9.356%2011.5h-1.21l1.089-5.48M15.566%208.342c.464%200%20.773.084.928.251.154.168.19.455.11.862-.084.424-.247.727-.488.908-.24.182-.607.272-1.1.272h-.742l.456-2.293h.836zm-2.974%204.615h1.22l.29-1.457h1.046c.461%200%20.84-.047%201.139-.142.298-.095.569-.254.812-.477.205-.184.37-.387.497-.608.127-.222.217-.466.27-.734.129-.65.032-1.155-.292-1.518-.324-.362-.84-.543-1.545-.543H13.68l-1.089%205.479z%22%20fill%3D%22%23FFF%22%2F%3E%3C%2Fsvg%3E) no-repeat center / 20px 20px;
a.phpdebugbar-restore-btn:after {
background: var(--debugbar-header) url(data:image/svg+xml,%3Csvg%20viewBox%3D%220%200%2020%2020%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Ccircle%20fill%3D%22%23000%22%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%229%22%2F%3E%3Cpath%20d%3D%22M6.039%208.342c.463%200%20.772.084.927.251.154.168.191.455.11.862-.084.424-.247.727-.487.908-.241.182-.608.272-1.1.272h-.743l.456-2.293h.837zm-2.975%204.615h1.22l.29-1.457H5.62c.461%200%20.84-.047%201.139-.142.298-.095.569-.254.812-.477.205-.184.37-.387.497-.608.127-.222.217-.466.27-.734.13-.65.032-1.155-.292-1.518-.324-.362-.84-.543-1.545-.543H4.153l-1.089%205.479zM9.235%206.02h1.21l-.289%201.458h1.079c.679%200%201.147.115%201.405.347.258.231.335.607.232%201.125l-.507%202.55h-1.23l.481-2.424c.055-.276.035-.464-.06-.565-.095-.1-.298-.15-.608-.15H9.98L9.356%2011.5h-1.21l1.089-5.48M15.566%208.342c.464%200%20.773.084.928.251.154.168.19.455.11.862-.084.424-.247.727-.488.908-.24.182-.607.272-1.1.272h-.742l.456-2.293h.836zm-2.974%204.615h1.22l.29-1.457h1.046c.461%200%20.84-.047%201.139-.142.298-.095.569-.254.812-.477.205-.184.37-.387.497-.608.127-.222.217-.466.27-.734.129-.65.032-1.155-.292-1.518-.324-.362-.84-.543-1.545-.543H13.68l-1.089%205.479z%22%20fill%3D%22%23FFF%22%2F%3E%3C%2Fsvg%3E) no-repeat center / 20px 20px;
}
div.phpdebugbar-header {
min-height: 26px;
background-color: var(--debugbar-header);
min-height: 32px;
line-height: 16px;
}
div.phpdebugbar-header:before, div.phpdebugbar-header:after {
@ -144,9 +237,9 @@ div.phpdebugbar-header-right {
}
div.phpdebugbar-header > div > * {
padding: 5px;
font-size: 14px;
height: 16px;
color: #555;
font-size: 13px;
height: 22px;
color: var(--debugbar-header-text);
text-decoration: none;
}
div.phpdebugbar-header-left > *,
@ -164,42 +257,46 @@ div.phpdebugbar-header-right > * {
div.phpdebugbar-header-right > select {
padding: 0;
line-height: 1em;
background-color: var(--debugbar-header);
color: var(--debugbar-header-text);
}
/* -------------------------------------- */
span.phpdebugbar-indicator,
a.phpdebugbar-indicator,
a.phpdebugbar-indicator
{
border-right: 1px solid #ddd;
border-right: 1px solid var(--debugbar-header-border);
}
.phpdebugbar[data-hideEmptyTabs=true] .phpdebugbar-tab[data-empty=true] {
display: none;
}
a.phpdebugbar-tab.phpdebugbar-active {
background: #ccc;
color: #444;
background-image: linear-gradient(bottom, rgb(173,173,173) 41%, rgb(209,209,209) 71%);
background-image: -o-linear-gradient(bottom, rgb(173,173,173) 41%, rgb(209,209,209) 71%);
background-image: -moz-linear-gradient(bottom, rgb(173,173,173) 41%, rgb(209,209,209) 71%);
background-image: -webkit-linear-gradient(bottom, rgb(173,173,173) 41%, rgb(209,209,209) 71%);
background-image: -ms-linear-gradient(bottom, rgb(173,173,173) 41%, rgb(209,209,209) 71%);
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0.41, rgb(173,173,173)), color-stop(0.71, rgb(209,209,209)));
background: var(--debugbar-active);
color: var(--debugbar-active-text);
}
a.phpdebugbar-tab .phpdebugbar-text {
font-size: 14px;
}
a.phpdebugbar-tab span.phpdebugbar-badge {
display: none;
margin-left: 5px;
font-size: 11px;
line-height: 14px;
padding: 0 6px;
background: #ccc;
background: var(--debugbar-badge);
border-radius: 4px;
color: #555;
color: var(--debugbar-badge-text);
font-weight: normal;
text-shadow: none;
}
a.phpdebugbar-tab.phpdebugbar-active span.phpdebugbar-badge {
background: #555;
color: #fff;
background: var(--debugbar-badge-active);
color: var(--debugbar-badge-active-text);
}
a.phpdebugbar-tab i {
display: none;
vertical-align: middle;
@ -212,9 +309,43 @@ a.phpdebugbar-tab.phpdebugbar-active {
color: white;
}
a.phpdebugbar-close-btn, a.phpdebugbar-open-btn, a.phpdebugbar-restore-btn, a.phpdebugbar-minimize-btn , a.phpdebugbar-maximize-btn {
a.phpdebugbar-close-btn,
a.phpdebugbar-open-btn,
a.phpdebugbar-restore-btn,
a.phpdebugbar-minimize-btn,
a.phpdebugbar-maximize-btn,
a.phpdebugbar-tab.phpdebugbar-tab-history,
a.phpdebugbar-tab.phpdebugbar-tab-settings {
width: 16px;
height: 16px;
height: 22px;
}
a.phpdebugbar-close-btn,
a.phpdebugbar-open-btn,
a.phpdebugbar-restore-btn,
a.phpdebugbar-minimize-btn ,
a.phpdebugbar-maximize-btn {
width: 16px;
height: 22px;
position: relative;
}
a.phpdebugbar-close-btn:after,
a.phpdebugbar-open-btn:after,
a.phpdebugbar-restore-btn:after,
a.phpdebugbar-minimize-btn:after,
a.phpdebugbar-maximize-btn:after {
background-color: var(--debugbar-icons);
content: " ";
display: block;
left: 0;
position: absolute;
top: 0;
width: 100%;
height: 100%;
}
a.phpdebugbar-restore-btn:after {
background-color: var(--debugbar-header);
}
a.phpdebugbar-maximize-btn { display: none}
@ -225,20 +356,20 @@ div.phpdebugbar-minimized a.phpdebugbar-maximize-btn { display: block}
div.phpdebugbar-minimized a.phpdebugbar-minimize-btn { display: none}
a.phpdebugbar-minimize-btn {
background:url(data:image/svg+xml,%3Csvg%20viewBox=%220%200%201792%201792%22%20fill=%22none%22%20xmlns=%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d=%22m1683%20653.5-742%20741c-12.667%2012.67-27.667%2019-45%2019s-32.333-6.33-45-19l-742-741c-12.667-12.667-19-27.833-19-45.5s6.333-32.833%2019-45.5l166-165c12.667-12.667%2027.667-19%2045-19s32.333%206.333%2045%2019l531%20531%20531-531c12.67-12.667%2027.67-19%2045-19s32.33%206.333%2045%2019l166%20165c12.67%2012.667%2019%2027.833%2019%2045.5s-6.33%2032.833-19%2045.5Z%22%20fill=%22%23555%22%2F%3E%3C%2Fsvg%3E) no-repeat center / 14px 14px;
a.phpdebugbar-minimize-btn:after {
mask:url(data:image/svg+xml,%3Csvg%20viewBox=%220%200%201792%201792%22%20fill=%22none%22%20xmlns=%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d=%22m1683%20653.5-742%20741c-12.667%2012.67-27.667%2019-45%2019s-32.333-6.33-45-19l-742-741c-12.667-12.667-19-27.833-19-45.5s6.333-32.833%2019-45.5l166-165c12.667-12.667%2027.667-19%2045-19s32.333%206.333%2045%2019l531%20531%20531-531c12.67-12.667%2027.67-19%2045-19s32.33%206.333%2045%2019l166%20165c12.67%2012.667%2019%2027.833%2019%2045.5s-6.33%2032.833-19%2045.5Z%22%20fill=%22%23555000%22%2F%3E%3C%2Fsvg%3E) no-repeat center / 14px 14px;
}
a.phpdebugbar-maximize-btn {
background: url(data:image/svg+xml,%3Csvg%20viewBox=%220%200%201792%201792%22%20fill=%22none%22%20xmlns=%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d=%22m1683%201229.5-166%20165c-12.67%2012.67-27.67%2019-45%2019s-32.33-6.33-45-19l-531-531-531%20531c-12.667%2012.67-27.667%2019-45%2019s-32.333-6.33-45-19l-166-165c-12.667-12.67-19-27.83-19-45.5s6.333-32.83%2019-45.5l742-741c12.667-12.667%2027.667-19%2045-19s32.333%206.333%2045%2019l742%20741c12.67%2012.67%2019%2027.83%2019%2045.5s-6.33%2032.83-19%2045.5Z%22%20fill=%22%23555%22%2F%3E%3C%2Fsvg%3E) no-repeat center / 14px 14px;
a.phpdebugbar-maximize-btn:after {
mask: url(data:image/svg+xml,%3Csvg%20viewBox=%220%200%201792%201792%22%20fill=%22none%22%20xmlns=%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d=%22m1683%201229.5-166%20165c-12.67%2012.67-27.67%2019-45%2019s-32.33-6.33-45-19l-531-531-531%20531c-12.667%2012.67-27.667%2019-45%2019s-32.333-6.33-45-19l-166-165c-12.667-12.67-19-27.83-19-45.5s6.333-32.83%2019-45.5l742-741c12.667-12.667%2027.667-19%2045-19s32.333%206.333%2045%2019l742%20741c12.67%2012.67%2019%2027.83%2019%2045.5s-6.33%2032.83-19%2045.5Z%22%20fill=%22%23000%22%2F%3E%3C%2Fsvg%3E) no-repeat center / 14px 14px;
}
a.phpdebugbar-close-btn {
background: url(data:image/svg+xml,%3Csvg%20viewBox=%220%200%201792%201792%22%20fill=%22none%22%20xmlns=%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d=%22M1490%201258c0%2026.67-9.33%2049.33-28%2068l-136%20136c-18.67%2018.67-41.33%2028-68%2028s-49.33-9.33-68-28l-294-294-294%20294c-18.667%2018.67-41.333%2028-68%2028s-49.333-9.33-68-28l-136-136c-18.667-18.67-28-41.33-28-68s9.333-49.33%2028-68l294-294-294-294c-18.667-18.667-28-41.333-28-68s9.333-49.333%2028-68l136-136c18.667-18.667%2041.333-28%2068-28s49.333%209.333%2068%2028l294%20294%20294-294c18.67-18.667%2041.33-28%2068-28s49.33%209.333%2068%2028l136%20136c18.67%2018.667%2028%2041.333%2028%2068s-9.33%2049.333-28%2068l-294%20294%20294%20294c18.67%2018.67%2028%2041.33%2028%2068Z%22%20fill=%22%23555%22%2F%3E%3C%2Fsvg%3E) no-repeat center / 14px 14px;
a.phpdebugbar-close-btn:after {
mask: url(data:image/svg+xml,%3Csvg%20viewBox=%220%200%201792%201792%22%20fill=%22none%22%20xmlns=%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d=%22M1490%201258c0%2026.67-9.33%2049.33-28%2068l-136%20136c-18.67%2018.67-41.33%2028-68%2028s-49.33-9.33-68-28l-294-294-294%20294c-18.667%2018.67-41.333%2028-68%2028s-49.333-9.33-68-28l-136-136c-18.667-18.67-28-41.33-28-68s9.333-49.33%2028-68l294-294-294-294c-18.667-18.667-28-41.333-28-68s9.333-49.333%2028-68l136-136c18.667-18.667%2041.333-28%2068-28s49.333%209.333%2068%2028l294%20294%20294-294c18.67-18.667%2041.33-28%2068-28s49.33%209.333%2068%2028l136%20136c18.67%2018.667%2028%2041.333%2028%2068s-9.33%2049.333-28%2068l-294%20294%20294%20294c18.67%2018.67%2028%2041.33%2028%2068Z%22%20fill=%22%23000%22%2F%3E%3C%2Fsvg%3E) no-repeat center / 14px 14px;
}
a.phpdebugbar-open-btn {
background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 1792 1792'%3e%3cpath fill='%23555' d='M1646 991.796c0 16.494-8.25 34.064-24.75 52.684l-268.22 316.13c-22.89 27.14-54.95 50.16-96.2 69.05S1177.4 1458 1142.27 1458H273.728c-18.095 0-34.194-3.46-48.297-10.38-14.104-6.92-21.155-18.36-21.155-34.32 0-16.5 8.249-34.06 24.747-52.69l268.228-316.13c22.884-27.14 54.949-50.156 96.194-69.049 41.246-18.893 79.431-28.34 114.556-28.34h868.549c18.09 0 34.19 3.459 48.3 10.378 14.1 6.918 21.15 18.361 21.15 34.327Zm-273.82-274.615v127.728H708.001c-50.027 0-102.448 12.64-157.264 37.919-54.817 25.28-98.457 57.078-130.921 95.397L150.79 1294.35l-3.992 4.79c0-2.13-.133-5.46-.399-9.98-.266-4.52-.399-7.85-.399-9.98V512.817c0-48.962 17.563-91.005 52.688-126.13 35.125-35.126 77.168-52.688 126.131-52.688h255.455c48.962 0 91.005 17.562 126.13 52.688 35.126 35.125 52.688 77.168 52.688 126.13v25.546h434.278c48.96 0 91 17.563 126.13 52.688 35.12 35.125 52.68 77.168 52.68 126.13Z'/%3e%3c/svg%3e") no-repeat center / 14px 14px;
a.phpdebugbar-open-btn:after {
mask: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 1792 1792'%3e%3cpath fill='%23000' d='M1646 991.796c0 16.494-8.25 34.064-24.75 52.684l-268.22 316.13c-22.89 27.14-54.95 50.16-96.2 69.05S1177.4 1458 1142.27 1458H273.728c-18.095 0-34.194-3.46-48.297-10.38-14.104-6.92-21.155-18.36-21.155-34.32 0-16.5 8.249-34.06 24.747-52.69l268.228-316.13c22.884-27.14 54.949-50.156 96.194-69.049 41.246-18.893 79.431-28.34 114.556-28.34h868.549c18.09 0 34.19 3.459 48.3 10.378 14.1 6.918 21.15 18.361 21.15 34.327Zm-273.82-274.615v127.728H708.001c-50.027 0-102.448 12.64-157.264 37.919-54.817 25.28-98.457 57.078-130.921 95.397L150.79 1294.35l-3.992 4.79c0-2.13-.133-5.46-.399-9.98-.266-4.52-.399-7.85-.399-9.98V512.817c0-48.962 17.563-91.005 52.688-126.13 35.125-35.126 77.168-52.688 126.131-52.688h255.455c48.962 0 91.005 17.562 126.13 52.688 35.126 35.125 52.688 77.168 52.688 126.13v25.546h434.278c48.96 0 91 17.563 126.13 52.688 35.12 35.125 52.68 77.168 52.68 126.13Z'/%3e%3c/svg%3e") no-repeat center / 14px 14px;
}
.phpdebugbar-indicator {
@ -251,10 +382,10 @@ a.phpdebugbar-open-btn {
.phpdebugbar-indicator span.phpdebugbar-tooltip {
display: none;
position: absolute;
top: -30px;
background: #efefef70;
border: 1px solid #ccc;
color: #555;
bottom: 38px;
background: var(--debugbar-header);
border: 1px solid var(--debugbar-header-border);
color: var(--debugbar-header-text);
font-size: 11px;
padding: 2px 6px;
z-index: 1000;
@ -268,20 +399,47 @@ a.phpdebugbar-open-btn {
.phpdebugbar-indicator:hover span.phpdebugbar-tooltip:not(.phpdebugbar-disabled) {
display: block;
}
.phpdebugbar-indicator span.phpdebugbar-tooltip dl {
display: grid;
grid-gap: 4px 10px;
grid-template-columns: max-content;
}
.phpdebugbar-indicator span.phpdebugbar-tooltip dl dt {
font-weight: bold;
text-align: left;
}
.phpdebugbar-indicator span.phpdebugbar-tooltip dl dd {
margin: 0;
grid-column-start: 2;
text-align: left;
}
select.phpdebugbar-datasets-switcher {
.phpdebugbar select.phpdebugbar-datasets-switcher {
float: right;
display: none;
margin: 2px 0 0 7px;
max-width: 200px;
max-height: 23px;
padding: 0;
height: 22px;
padding: 4px 0;
border: none;
}
.phpdebugbar button,
.phpdebugbar-openhandler button {
color: var(--debugbar-header-text);
background-color: var(--debugbar-header);
border: 1px solid var(--debugbar-header-border);
border-radius: 0.25rem;
margin: 0 5px;
padding: 0 12px;
height: 20px;
line-height: normal;
cursor: pointer;
}
/* -------------------------------------- */
div.phpdebugbar-body {
border-top: 1px solid #ccc;
border-top: 1px solid var(--debugbar-header-border);
display: none;
position: relative;
height: 300px;
@ -303,7 +461,7 @@ div.phpdebugbar-panel.phpdebugbar-active {
div.phpdebugbar-mini-design a.phpdebugbar-tab {
position: relative;
border-right: 1px solid #ddd;
border-right: 1px solid var(--debugbar-header-border);
}
div.phpdebugbar-mini-design a.phpdebugbar-tab span.phpdebugbar-text {
display: none;
@ -312,10 +470,10 @@ div.phpdebugbar-mini-design a.phpdebugbar-tab {
display: block;
position: absolute;
top: -30px;
background: #efefef70;
background: var(--debugbar-background);
opacity: 1;
border: 1px solid #ccc;
color: #555;
border: 1px solid var(--debugbar-header-border);
color: var(--debugbar-header-text);
font-size: 11px;
padding: 2px 6px;
z-index: 1000;
@ -332,18 +490,23 @@ div.phpdebugbar-mini-design a.phpdebugbar-tab {
/* -------------------------------------- */
a.phpdebugbar-tab.phpdebugbar-tab-history {
min-width: 16px;
height: 16px;
width: auto;
min-width: 22px;
}
a.phpdebugbar-tab.phpdebugbar-tab-history,
a.phpdebugbar-tab.phpdebugbar-tab-settings {
display: flex;
justify-content: center;
align-items: center;
}
a.phpdebugbar-tab.phpdebugbar-tab-history .phpdebugbar-text {
a.phpdebugbar-tab.phpdebugbar-tab-history .phpdebugbar-text,
a.phpdebugbar-tab.phpdebugbar-tab-settings .phpdebugbar-text {
display: none;
white-space: nowrap;
}
a.phpdebugbar-tab.phpdebugbar-tab-history i {
a.phpdebugbar-tab.phpdebugbar-tab-history i,
a.phpdebugbar-tab.phpdebugbar-tab-settings i{
display:inline-block;
}
.phpdebugbar-widgets-dataset-history table {
@ -355,7 +518,7 @@ div.phpdebugbar-mini-design a.phpdebugbar-tab {
}
.phpdebugbar-widgets-dataset-history table td, .phpdebugbar-widgets-dataset-history table th {
padding: 6px 3px;
border-bottom: 1px solid #ddd;
border-bottom: 1px solid var(--debugbar-border);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
@ -366,17 +529,17 @@ div.phpdebugbar-mini-design a.phpdebugbar-tab {
text-overflow: ellipsis;
}
.phpdebugbar-widgets-dataset-history table tr.phpdebugbar-widgets-active {
background: #ccc;
color: #444;
background: var(--debugbar-active);
color: var(--debugbar-active-text);
}
.phpdebugbar-widgets-dataset-history span.phpdebugbar-badge {
margin: 0 5px 0 2px;
font-size: 11px;
line-height: 14px;
padding: 0 6px;
background: #ccc;
background: var(--debugbar-badge);
border-radius: 4px;
color: #555;
color: var(--debugbar-badge-text);
font-weight: normal;
text-shadow: none;
vertical-align: middle;
@ -386,7 +549,7 @@ div.phpdebugbar-mini-design a.phpdebugbar-tab {
padding: 7px 0;
position: sticky;
top: 0;
background: #fff;
background: var(--debugbar-background);
}
.phpdebugbar-widgets-dataset-history .phpdebugbar-widgets-dataset-actions a {
margin: 0 10px;
@ -395,3 +558,37 @@ div.phpdebugbar-mini-design a.phpdebugbar-tab {
appearance: checkbox !important;
margin: 5px;
}
/* -------------------------------------- */
.phpdebugbar-settings .phpdebugbar-form-row {
display: block;
border-top: 1px solid var(--debugbar-border);
min-height: 17px;
padding: 5px 10px;
}
.phpdebugbar-settings .phpdebugbar-form-label {
width: 200px;
font-weight: bold;
display: inline-block;
clear: none;
}
.phpdebugbar-settings .phpdebugbar-form-input {
font-weight: bold;
display: inline-block;
clear: none;
}
.phpdebugbar-settings input[type="text"],
.phpdebugbar-settings select
{
margin: 0 5px;
min-width: 200px;
}
.phpdebugbar-settings input[type="checkbox"]
{
margin: 0 5px;
}

@ -256,7 +256,6 @@ if (typeof(PhpDebugBar) == 'undefined') {
render: function() {
this.$tab = $('<a />').addClass(csscls('tab'));
this.$icon = $('<i />').appendTo(this.$tab);
this.bindAttr('icon', function(icon) {
if (icon) {
@ -285,6 +284,7 @@ if (typeof(PhpDebugBar) == 'undefined') {
this.bindAttr('data', function(data) {
if (this.has('widget')) {
this.get('widget').set('data', data);
this.$tab.attr('data-empty', $.isEmptyObject(data));
}
})
}
@ -326,7 +326,16 @@ if (typeof(PhpDebugBar) == 'undefined') {
this.$tooltip = $('<span />').addClass(csscls('tooltip disabled')).appendTo(this.$el);
this.bindAttr('tooltip', function(tooltip) {
if (tooltip) {
this.$tooltip.text(tooltip).removeClass(csscls('disabled'));
var dl = $('<dl />');
if (Array.isArray(tooltip) || typeof tooltip === 'object') {
$.each(tooltip, function(key, value) {
$('<dt />').text(key).appendTo(dl);
$('<dd />').text(value).appendTo(dl);
});
this.$tooltip.html(dl).removeClass(csscls('disabled'));
} else {
this.$tooltip.text(tooltip).removeClass(csscls('disabled'));
}
} else {
this.$tooltip.addClass(csscls('disabled'));
}
@ -335,6 +344,150 @@ if (typeof(PhpDebugBar) == 'undefined') {
});
/**
* Displays datasets in a table
*
*/
var Settings = Widget.extend({
tagName: 'form',
className: csscls('settings'),
settings: {},
initialize: function(options) {
this.set(options);
var debugbar = this.get('debugbar');
this.settings = JSON.parse(localStorage.getItem('phpdebugbar-settings')) || {};
$.each(debugbar.options, (key, value)=> {
if (key in this.settings) {
debugbar.options[key] = this.settings[key];
}
// Theme requires dark/light mode detection
if (key === 'theme') {
debugbar.setTheme(debugbar.options[key]);
} else {
debugbar.$el.attr('data-' + key, debugbar.options[key]);
}
})
},
clearSettings: function() {
var debugbar = this.get('debugbar');
// Remove item from storage
localStorage.removeItem('phpdebugbar-settings');
localStorage.removeItem('phpdebugbar-ajaxhandler-autoshow');
this.settings = {};
// Reset options
debugbar.options = debugbar.defaultOptions;
debugbar.setTheme(debugbar.options.theme);
// Reset ajax handler
if (debugbar.ajaxHandler) {
var autoshow = debugbar.ajaxHandler.defaultAutoShow;
debugbar.ajaxHandler.setAutoShow(autoshow);
this.set('autoshow', autoshow);
if(debugbar.controls['__datasets']) {
debugbar.controls['__datasets'].get('widget').set('autoshow', $(this).is(':checked'));
}
}
},
storeSetting: function(key, value) {
this.settings[key] = value;
var debugbar = this.get('debugbar');
debugbar.options[key] = value;
if (key !== 'theme') {
debugbar.$el.attr('data-' + key, value);
}
localStorage.setItem('phpdebugbar-settings', JSON.stringify(this.settings));
},
render: function() {
this.$el.empty();
var debugbar = this.get('debugbar');
var self = this;
var fields = {};
// Set Theme
fields["Theme"] = $('<select>' +
'<option value="auto">Auto (System preference)</option>' +
'<option value="light">Light</option>' +
'<option value="dark">Dark</option>' +
'</select>')
.val(debugbar.options.theme)
.on('change', function() {
self.storeSetting('theme', $(this).val())
debugbar.setTheme($(this).val());
});
fields["Open Button Position"] = $('<select>' +
'<option value="bottomLeft">Bottom Left</option>' +
'<option value="bottomRight">Bottom Right</option>' +
'<option value="topLeft">Top Left</option>' +
'<option value="topRight">Top Right</option>' +
'</select>')
.val(debugbar.options.openBtnPosition)
.on('change', function() {
self.storeSetting('openBtnPosition', $(this).val())
});
this.$hideEmptyTabs = $('<input type=checkbox>')
.prop('checked', debugbar.options.hideEmptyTabs)
.on('click', function() {
self.storeSetting('hideEmptyTabs', $(this).is(':checked'));
});
fields["Hide Empty Tabs"] = $('<label/>').append(this.$hideEmptyTabs, 'Hide empty tabs until they have data');
this.$autoshow = $('<input type=checkbox>')
.prop('checked', debugbar.ajaxHandler && debugbar.ajaxHandler.autoShow)
.on('click', function() {
if (debugbar.ajaxHandler) {
debugbar.ajaxHandler.setAutoShow($(this).is(':checked'));
}
if (debugbar.controls['__datasets']) {
debugbar.controls['__datasets'].get('widget').set('autoshow', $(this).is(':checked'));
}
});
this.bindAttr('autoshow', function() {
this.$autoshow.prop('checked', this.get('autoshow')).closest('.form-row').show();
})
fields["Autoshow"] = $('<label/>').append(this.$autoshow, 'Automatically show new incoming Ajax requests');
fields["Reset to defaults"] = $('<button>Reset settings</button>').on('click', function(e) {
e.preventDefault();
self.clearSettings();
self.render();
})
$.each(fields, function(key, value) {
$('<div />').addClass(csscls('form-row')).append(
$('<div />').addClass(csscls('form-label')).text(key),
$('<div />').addClass(csscls('form-input')).html(value)
).appendTo(self.$el);
})
if (!this.ajaxHandler) {
this.$autoshow.closest('.form-row').hide();
}
},
});
// ------------------------------------------------------------------
/**
@ -413,10 +566,14 @@ if (typeof(PhpDebugBar) == 'undefined') {
options: {
bodyMarginBottom: true,
bodyMarginBottomHeight: 0
theme: 'auto',
openBtnPosition: 'bottomLeft',
hideEmptyTabs: false,
},
initialize: function() {
initialize: function(options = {}) {
this.options = $.extend(this.options, options);
this.defaultOptions = { ...this.options };
this.controls = {};
this.dataMap = {};
this.datasets = {};
@ -424,13 +581,19 @@ if (typeof(PhpDebugBar) == 'undefined') {
this.activePanelName = null;
this.activeDatasetId = null;
this.datesetTitleFormater = new DatasetTitleFormater(this);
this.options.bodyMarginBottomHeight = parseInt($('body').css('margin-bottom'));
this.bodyMarginBottomHeight = parseInt($('body').css('margin-bottom'));
try {
this.isIframe = window.self !== window.top && window.top.phpdebugbar;
} catch (error) {
this.isIframe = false;
}
this.registerResizeHandler();
this.registerMediaListener();
// Attach settings
this.settings = new PhpDebugBar.DebugBar.Tab({"icon":"sliders", "title":"Settings", "widget": new Settings({
'debugbar': this,
})});
},
/**
@ -447,6 +610,29 @@ if (typeof(PhpDebugBar) == 'undefined') {
setTimeout(f, 20);
},
registerMediaListener: function() {
const mediaQueryList = window.matchMedia("(prefers-color-scheme: dark)");
mediaQueryList.addEventListener('change', event => {
if (this.options.theme === 'auto') {
this.setTheme('auto');
}
})
},
setTheme: function(theme) {
this.options.theme = theme;
if (theme === 'auto') {
const mediaQueryList = window.matchMedia("(prefers-color-scheme: dark)");
theme = mediaQueryList.matches ? 'dark' : 'light';
}
this.$el.attr('data-theme', theme)
if (this.openHandler) {
this.openHandler.$el.attr('data-theme', theme)
}
},
/**
* Resizes the debugbar to fit the current browser window
*/
@ -554,6 +740,21 @@ if (typeof(PhpDebugBar) == 'undefined') {
this.$datasets.change(function() {
self.showDataSet(this.value);
});
this.controls['__settings'] = this.settings;
this.settings.$tab.addClass(csscls('tab-settings'));
this.settings.$tab.attr('data-collector', '__settings');
this.settings.$el.attr('data-collector', '__settings');
this.settings.$tab.insertAfter(this.$minimizebtn).show();
this.settings.$tab.click(() => {
if (!this.isMinimized() && this.activePanelName == '__settings') {
this.minimize();
} else {
this.showTab('__settings');
this.settings.get('widget').render();
}
});
this.settings.$el.appendTo(this.$body);
},
/**
@ -641,7 +842,8 @@ if (typeof(PhpDebugBar) == 'undefined') {
} else {
self.showTab(name);
}
});
})
tab.$tab.attr('data-empty', true);
tab.$tab.attr('data-collector', name);
tab.$el.attr('data-collector', name);
tab.$el.appendTo(this.$body);
@ -659,7 +861,7 @@ if (typeof(PhpDebugBar) == 'undefined') {
* @this {DebugBar}
* @param {String} name Internal name
* @param {String} icon
* @param {String} tooltip
* @param {String|Object} tooltip
* @param {String} position "right" or "left", default is "right"
* @return {Indicator}
*/
@ -868,10 +1070,10 @@ if (typeof(PhpDebugBar) == 'undefined') {
recomputeBottomOffset: function() {
if (this.options.bodyMarginBottom) {
if (this.isClosed()) {
return $('body').css('margin-bottom', this.options.bodyMarginBottomHeight || '');
return $('body').css('margin-bottom', this.bodyMarginBottomHeight || '');
}
var offset = parseInt(this.$el.height()) + (this.options.bodyMarginBottomHeight || 0);
var offset = parseInt(this.$el.height()) + (this.bodyMarginBottomHeight || 0);
$('body').css('margin-bottom', offset);
}
},
@ -1075,7 +1277,7 @@ if (typeof(PhpDebugBar) == 'undefined') {
this.datasetTab.$el.attr('data-collector', '__datasets');
this.datasetTab.$tab.insertAfter(this.$openbtn).hide();
this.datasetTab.$tab.click(() => {
if (!this.isMinimized() && self.activePanelName == '__datasets') {
if (!this.isMinimized() && this.activePanelName == '__datasets') {
this.minimize();
} else {
this.showTab('__datasets');
@ -1084,7 +1286,6 @@ if (typeof(PhpDebugBar) == 'undefined') {
this.datasetTab.$el.appendTo(this.$body);
this.controls['__datasets'] = this.datasetTab;
},
});
DebugBar.Tab = Tab;
@ -1103,9 +1304,13 @@ if (typeof(PhpDebugBar) == 'undefined') {
this.debugbar = debugbar;
this.headerName = headerName || 'phpdebugbar';
this.autoShow = typeof(autoShow) == 'undefined' ? true : autoShow;
this.defaultAutoShow = this.autoShow;
if (localStorage.getItem('phpdebugbar-ajaxhandler-autoshow') !== null) {
this.autoShow = localStorage.getItem('phpdebugbar-ajaxhandler-autoshow') == '1';
}
if (debugbar.controls['__settings']) {
debugbar.controls['__settings'].get('widget').set('autoshow', this.autoShow);
}
};
$.extend(AjaxHandler.prototype, {

@ -16,31 +16,47 @@ div.phpdebugbar-openhandler {
bottom: 0;
left: 0;
right: 0;
width: 70%;
width: 80%;
height: 70%;
background: #fff;
color: #000;
border: 2px solid #888;
background: var(--debugbar-background);
color: var(--debugbar-text);
border: 2px solid var(--debugbar-header-border);
overflow: auto;
z-index: 20001;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif;
font-family: var(--debugbar-font-sans);
font-size: 14px;
padding-bottom: 10px;
padding: 0;
}
div.phpdebugbar-openhandler input, div.phpdebugbar-openhandler select {
color: var(--debugbar-header-text);
background-color: var(--debugbar-header);
border: 1px solid var(--debugbar-header-border);
border-radius: 0.25rem;
height: 20px;
margin: 0 5px;
}
div.phpdebugbar-openhandler .phpdebugbar-openhandler-actions input[name="uri"] {
width: 200px;
}
div.phpdebugbar-openhandler .phpdebugbar-openhandler-actions input[name="ip"] {
width: 90px;
}
div.phpdebugbar-openhandler a {
color: #555;
color: var(--debugbar-header-text);
}
div.phpdebugbar-openhandler .phpdebugbar-openhandler-header {
background: #efefef url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAUCAYAAABvVQZ0AAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQ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k0nzaJ1+s7nU4NysTupLRtW5ZKJVmpVOWpkz/LjkRCFgoFaduOrFarcnb2quzb0ytnZmZktVaT5fJNWSqV5P59+2RTU9Npxa/5e10p0XU/lmUxOryX7q5OIpEw4xPjxOMxnn/uWdqeaCNmxhgeHSSVSvHi2BidyS6OHv2S9z94D1e6exQzauqObZMeSGOtWNiOQ9iI4iIZGhplfb1CNpulNWyiqAr2xi0A5nN5QiEDze+n0QAkmic7/+diZ6K7bXLyTTxNKr19T/Hq+Css5Be4vpinWCwS8BsEQi3UajVMM45t24zsHaKv72leG59gcuINFKEsC6/X+13cfOT1S1cu8u03x8jl8ti2zfT0NCMjo9RqFS5fyhAMBejp6WZsbD9mLM6pk7+gqio/Hf+Ret1hLpv5Xhgh4+WwEZmey84ykO5HuuqWMwXgOA6ffzHF1NQR5jJ5FPWuxZaWCwcEEHzs0cfPeVtangwGjQdOfbVSpcXrRd0ktFZazVzLzw8rQHlpuXA4FAo/lIU0v3aPkBCCxesLh4Gyeic2c+Ov5d0xM57arsWtcF2XCxdnvpJSfgygbrr7wbJWioYRfqm5uXlH+6iqSr1eJ3P1yjuudD/cbp8BJIUQX/enBoYbjcaWQr//8ds5KeXbQG6n5biZXcABIDaYHkn+ev5sDvgbmAYW+L/5B5NrVZNHcIujAAAAAElFTkSuQmCC) no-repeat 5px 4px;
padding-left: 29px;
min-height: 26px;
line-height: 25px;
color: #555;
color: var(--debugbar-header-text);
margin-bottom: 10px;
}
div.phpdebugbar-openhandler .phpdebugbar-openhandler-header a {
font-size: 14px;
color: #555;
color: var(--debugbar-header-text);
text-decoration: none;
float: right;
padding: 5px 8px;
@ -52,7 +68,7 @@ div.phpdebugbar-openhandler {
}
div.phpdebugbar-openhandler table td {
padding: 6px 3px;
border-bottom: 1px solid #ddd;
border-bottom: 1px solid var(--debugbar-border);
}
div.phpdebugbar-openhandler table td a{
display: block;
@ -65,6 +81,10 @@ div.phpdebugbar-openhandler {
padding: 7px 0;
}
div.phpdebugbar-openhandler .phpdebugbar-openhandler-actions a {
margin: 0 10px;
color: #555;
color: var(--debugbar-header-text);
background-color: var(--debugbar-header);
border: 1px solid var(--debugbar-header-border);
border-radius: 0.25rem;
margin: 5px;
padding: 4px 12px 4px;
}

@ -94,9 +94,9 @@ if (typeof(PhpDebugBar) == 'undefined') {
$('<form />')
.append('<br/><b>Filter results</b><br/>')
.append('Method: <select name="method"><option></option><option>GET</option><option>POST</option><option>PUT</option><option>DELETE</option></select><br/>')
.append('Uri: <input type="text" name="uri"><br/>')
.append('IP: <input type="text" name="ip"><br/>')
.append('<select name="method"><option selected>(Method)</option><option>GET</option><option>POST</option><option>PUT</option><option>DELETE</option></select>')
.append('<input type="text" name="uri" placeholder="URI">')
.append('<input type="text" name="ip" placeholder="IP">')
.append(searchBtn)
.appendTo(this.$actions);
},
@ -190,7 +190,7 @@ if (typeof(PhpDebugBar) == 'undefined') {
ajax: function(data, callback) {
var url = this.get('url');
if (data) {
url = url + '?' + new URLSearchParams(data);
url = url + ( url.includes('?') ? '&' : '?' ) + new URLSearchParams(data);
}
fetch(url, {

File diff suppressed because one or more lines are too long

@ -1,8 +1,3 @@
/*
github.com style (c) Vasily Polovnyov <vast@whiteants.net>
*/
div.phpdebugbar pre code.hljs {
display: block;
overflow-x: auto;
@ -11,72 +6,219 @@ div.phpdebugbar pre code.hljs {
div.phpdebugbar code.hljs {
padding: 3px 5px;
}
/*!
Theme: GitHub
Description: Light theme as seen on github.com
Author: github.com
Maintainer: @Hirse
Updated: 2021-05-15
Outdated base version: https://github.com/primer/github-syntax-light
Current colors taken from GitHub's CSS
*/
div.phpdebugbar .hljs {
background: #f3f3f3;
color: #444;
color: var(--debugbar-text);
}
div.phpdebugbar .hljs-comment {
color: #697070;
}
div.phpdebugbar .hljs-punctuation,
div.phpdebugbar .hljs-tag {
color: #444a;
}
div.phpdebugbar .hljs-tag .hljs-attr,
div.phpdebugbar .hljs-tag .hljs-name {
color: #444;
}
div.phpdebugbar .hljs-attribute,
div.phpdebugbar .hljs-doctag,
div.phpdebugbar .hljs-keyword,
div.phpdebugbar .hljs-meta .hljs-keyword,
div.phpdebugbar .hljs-name,
div.phpdebugbar .hljs-selector-tag {
font-weight: 700;
}
div.phpdebugbar .hljs-deletion,
div.phpdebugbar .hljs-number,
div.phpdebugbar .hljs-quote,
div.phpdebugbar .hljs-selector-class,
div.phpdebugbar .hljs-selector-id,
div.phpdebugbar .hljs-string,
div.phpdebugbar .hljs-meta div.phpdebugbar .hljs-keyword,
div.phpdebugbar .hljs-template-tag,
div.phpdebugbar .hljs-type {
color: #800;
}
div.phpdebugbar .hljs-section,
div.phpdebugbar .hljs-title {
color: #800;
font-weight: 700;
}
div.phpdebugbar .hljs-link,
div.phpdebugbar .hljs-operator,
div.phpdebugbar .hljs-regexp,
div.phpdebugbar .hljs-selector-attr,
div.phpdebugbar .hljs-selector-pseudo,
div.phpdebugbar .hljs-symbol,
div.phpdebugbar .hljs-template-variable,
div.phpdebugbar .hljs-variable {
color: #ab5656;
div.phpdebugbar .hljs-type,
div.phpdebugbar .hljs-variable.language_ {
/* prettylights-syntax-keyword */
color: #d73a49
}
div.phpdebugbar .hljs-literal {
color: #695;
div.phpdebugbar .hljs-title,
div.phpdebugbar .hljs-title.class_,
div.phpdebugbar .hljs-title.class_.inherited__,
div.phpdebugbar .hljs-title.function_ {
/* prettylights-syntax-entity */
color: #6f42c1
}
div.phpdebugbar .hljs-attr,
div.phpdebugbar .hljs-attribute,
div.phpdebugbar .hljs-literal,
div.phpdebugbar .hljs-meta,
div.phpdebugbar .hljs-number,
div.phpdebugbar .hljs-operator,
div.phpdebugbar .hljs-variable,
div.phpdebugbar .hljs-selector-attr,
div.phpdebugbar .hljs-selector-class,
div.phpdebugbar .hljs-selector-id {
/* prettylights-syntax-constant */
color: #005cc5
}
div.phpdebugbar .hljs-regexp,
div.phpdebugbar .hljs-string,
div.phpdebugbar .hljs-meta div.phpdebugbar .hljs-string {
/* prettylights-syntax-string */
color: #032f62
}
div.phpdebugbar .hljs-addition,
div.phpdebugbar .hljs-built_in,
div.phpdebugbar .hljs-bullet,
div.phpdebugbar .hljs-code {
color: #397300;
div.phpdebugbar .hljs-symbol {
/* prettylights-syntax-variable */
color: #e36209
}
div.phpdebugbar .hljs-meta {
color: #1f7199;
div.phpdebugbar .hljs-comment,
div.phpdebugbar .hljs-code,
div.phpdebugbar .hljs-formula {
/* prettylights-syntax-comment */
color: #6a737d
}
div.phpdebugbar .hljs-meta .hljs-string {
color: #38a;
div.phpdebugbar .hljs-name,
div.phpdebugbar .hljs-quote,
div.phpdebugbar .hljs-selector-tag,
div.phpdebugbar .hljs-selector-pseudo {
/* prettylights-syntax-entity-tag */
color: #22863a
}
div.phpdebugbar .hljs-subst {
/* prettylights-syntax-storage-modifier-import */
color: #24292e
}
div.phpdebugbar .hljs-section {
/* prettylights-syntax-markup-heading */
color: #005cc5;
font-weight: bold
}
div.phpdebugbar .hljs-bullet {
/* prettylights-syntax-markup-list */
color: #735c0f
}
div.phpdebugbar .hljs-emphasis {
font-style: italic;
/* prettylights-syntax-markup-italic */
color: #24292e;
font-style: italic
}
div.phpdebugbar .hljs-strong {
font-weight: 700;
/* prettylights-syntax-markup-bold */
color: #24292e;
font-weight: bold
}
div.phpdebugbar .hljs-addition {
/* prettylights-syntax-markup-inserted */
color: #22863a;
background-color: #f0fff4
}
div.phpdebugbar .hljs-deletion {
/* prettylights-syntax-markup-deleted */
color: #b31d28;
background-color: #ffeef0
}
div.phpdebugbar .hljs-char.escape_,
div.phpdebugbar .hljs-link,
div.phpdebugbar .hljs-params,
div.phpdebugbar .hljs-property,
div.phpdebugbar .hljs-punctuation,
div.phpdebugbar .hljs-tag {
/* purposely ignored */
}
/*!
Theme: GitHub Dark
Description: Dark theme as seen on github.com
Author: github.com
Maintainer: @Hirse
Updated: 2021-05-15
Outdated base version: https://github.com/primer/github-syntax-dark
Current colors taken from GitHub's CSS
*/
div.phpdebugbar[data-theme='dark'] .hljs-doctag,
div.phpdebugbar[data-theme='dark'] .hljs-keyword,
div.phpdebugbar[data-theme='dark'] .hljs-meta div.phpdebugbar[data-theme='dark'] .hljs-keyword,
div.phpdebugbar[data-theme='dark'] .hljs-template-tag,
div.phpdebugbar[data-theme='dark'] .hljs-template-variable,
div.phpdebugbar[data-theme='dark'] .hljs-type,
div.phpdebugbar[data-theme='dark'] .hljs-variable.language_ {
/* prettylights-syntax-keyword */
color: #ff7b72
}
div.phpdebugbar[data-theme='dark'] .hljs-title,
div.phpdebugbar[data-theme='dark'] .hljs-title.class_,
div.phpdebugbar[data-theme='dark'] .hljs-title.class_.inherited__,
div.phpdebugbar[data-theme='dark'] .hljs-title.function_ {
/* prettylights-syntax-entity */
color: #d2a8ff
}
div.phpdebugbar[data-theme='dark'] .hljs-attr,
div.phpdebugbar[data-theme='dark'] .hljs-attribute,
div.phpdebugbar[data-theme='dark'] .hljs-literal,
div.phpdebugbar[data-theme='dark'] .hljs-meta,
div.phpdebugbar[data-theme='dark'] .hljs-number,
div.phpdebugbar[data-theme='dark'] .hljs-operator,
div.phpdebugbar[data-theme='dark'] .hljs-variable,
div.phpdebugbar[data-theme='dark'] .hljs-selector-attr,
div.phpdebugbar[data-theme='dark'] .hljs-selector-class,
div.phpdebugbar[data-theme='dark'] .hljs-selector-id {
/* prettylights-syntax-constant */
color: #79c0ff
}
div.phpdebugbar[data-theme='dark'] .hljs-regexp,
div.phpdebugbar[data-theme='dark'] .hljs-string,
div.phpdebugbar[data-theme='dark'] .hljs-meta div.phpdebugbar[data-theme='dark'] .hljs-string {
/* prettylights-syntax-string */
color: #a5d6ff
}
div.phpdebugbar[data-theme='dark'] .hljs-built_in,
div.phpdebugbar[data-theme='dark'] .hljs-symbol {
/* prettylights-syntax-variable */
color: #ffa657
}
div.phpdebugbar[data-theme='dark'] .hljs-comment,
div.phpdebugbar[data-theme='dark'] .hljs-code,
div.phpdebugbar[data-theme='dark'] .hljs-formula {
/* prettylights-syntax-comment */
color: #8b949e
}
div.phpdebugbar[data-theme='dark'] .hljs-name,
div.phpdebugbar[data-theme='dark'] .hljs-quote,
div.phpdebugbar[data-theme='dark'] .hljs-selector-tag,
div.phpdebugbar[data-theme='dark'] .hljs-selector-pseudo {
/* prettylights-syntax-entity-tag */
color: #7ee787
}
div.phpdebugbar[data-theme='dark'] .hljs-subst {
/* prettylights-syntax-storage-modifier-import */
color: #c9d1d9
}
div.phpdebugbar[data-theme='dark'] .hljs-section {
/* prettylights-syntax-markup-heading */
color: #1f6feb;
font-weight: bold
}
div.phpdebugbar[data-theme='dark'] .hljs-bullet {
/* prettylights-syntax-markup-list */
color: #f2cc60
}
div.phpdebugbar[data-theme='dark'] .hljs-emphasis {
/* prettylights-syntax-markup-italic */
color: #c9d1d9;
font-style: italic
}
div.phpdebugbar[data-theme='dark'] .hljs-strong {
/* prettylights-syntax-markup-bold */
color: #c9d1d9;
font-weight: bold
}
div.phpdebugbar[data-theme='dark'] .hljs-addition {
/* prettylights-syntax-markup-inserted */
color: #aff5b4;
background-color: #033a16
}
div.phpdebugbar[data-theme='dark'] .hljs-deletion {
/* prettylights-syntax-markup-deleted */
color: #ffdcd7;
background-color: #67060c
}
div.phpdebugbar[data-theme='dark'] .hljs-char.escape_,
div.phpdebugbar[data-theme='dark'] .hljs-link,
div.phpdebugbar[data-theme='dark'] .hljs-params,
div.phpdebugbar[data-theme='dark'] .hljs-property,
div.phpdebugbar[data-theme='dark'] .hljs-punctuation,
div.phpdebugbar[data-theme='dark'] .hljs-tag {
/* purposely ignored */
}

@ -17,7 +17,7 @@ pre.phpdebugbar-widgets-code-block {
}
pre.phpdebugbar-widgets-code-block ul li.phpdebugbar-widgets-highlighted-line span {
position: absolute;
background: #800000;
background: var(--debugbar-text);
min-width: calc(100% - 85px);
margin-left: 10px;
opacity: 0.15;
@ -26,8 +26,7 @@ pre.phpdebugbar-widgets-code-block {
position: static;
float: left;
padding: 5px;
background: #cacaca;
border-right: 1px solid #aaa;
border-right: 1px solid var(--debugbar-header-border);
text-align: right;
}
@ -37,11 +36,15 @@ pre.phpdebugbar-widgets-code-block {
font-style: italic;
float: right;
margin-left: 8px;
color: #888;
color: var(--debugbar-link);
}
a.phpdebugbar-widgets-editor-link {
color: var(--debugbar-link);
}
.phpdebugbar-widgets-kvlist span.phpdebugbar-widgets-filename:hover,
li.phpdebugbar-widgets-list-item span.phpdebugbar-widgets-filename:hover,
a.phpdebugbar-widgets-editor-link:hover {
color: #aaaaaa;
color: var(--debugbar-hover);
}
a.phpdebugbar-widgets-editor-link:before {
@ -62,17 +65,14 @@ ul.phpdebugbar-widgets-list {
margin: 0;
padding: 0;
list-style: none;
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
font-family: var(--debugbar-font-mono);
}
ul.phpdebugbar-widgets-list li.phpdebugbar-widgets-list-item {
padding: 3px;
border-bottom: 1px solid #eee;
border-bottom: 1px solid var(--debugbar-border);
position: relative;
overflow: hidden;
}
ul.phpdebugbar-widgets-list li.phpdebugbar-widgets-list-item:hover {
background: #fafafa;
}
/* -------------------------------------- */
@ -134,13 +134,18 @@ div.phpdebugbar-widgets-messages {
position: fixed;
bottom: 0;
width: 100%;
background: #fff;
background: var(--debugbar-header);
color: var(--debugbar-text);
border-top: 1px solid var(--debugbar-border);
border-bottom: 0px;
height: 20px;
padding: 4px 0px 4px;
}
div.phpdebugbar-widgets-messages li .phpdebugbar-widgets-label-called-from {
float: right;
color: #666;
color: var(--debugbar-text-muted);
padding-left: 5px;
border-bottom: 1px dotted #666;
border-bottom: 1px dotted var(--debugbar-border);
}
div.phpdebugbar-widgets-messages li .phpdebugbar-widgets-label-called-from:before {
content: "\f08d";
@ -152,8 +157,11 @@ div.phpdebugbar-widgets-messages {
border: 0;
margin: 0;
margin-left: 7px;
width: 50%;
width: 30%;
box-shadow: none;
border-radius: 3px;
padding: 2px 6px;
height: 15px;
}
div.phpdebugbar-widgets-messages div.phpdebugbar-widgets-toolbar input:focus {
outline: none;
@ -165,12 +173,12 @@ div.phpdebugbar-widgets-messages {
background: #7cacd5;
margin: 0 2px;
border-radius: 4px;
color: #fff;
color: var(--debugbar-background);
text-decoration: none;
}
div.phpdebugbar-widgets-messages div.phpdebugbar-widgets-toolbar a.phpdebugbar-widgets-filter.phpdebugbar-widgets-excluded {
background: #eee;
color: #888;
background: var(--debugbar-active);
color: var(--debugbar-text-muted);
}
/* -------------------------------------- */
@ -182,7 +190,7 @@ dl.phpdebugbar-widgets-kvlist {
float: left;
width: 150px;
padding: 5px;
border-top: 1px solid #eee;
border-top: 1px solid var(--debugbar-border);
font-weight: bold;
clear: both;
overflow: hidden;
@ -192,7 +200,7 @@ dl.phpdebugbar-widgets-kvlist {
dl.phpdebugbar-widgets-kvlist dd {
margin-left: 160px;
padding: 5px;
border-top: 1px solid #eee;
border-top: 1px solid var(--debugbar-border);
cursor: pointer;
min-height: 17px;
}
@ -201,7 +209,7 @@ dl.phpdebugbar-widgets-kvlist {
dl.phpdebugbar-widgets-varlist,
dl.phpdebugbar-widgets-htmlvarlist {
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
font-family: var(--debugbar-font-mono);
}
dl.phpdebugbar-widgets-htmlvarlist dd {
cursor: initial;
@ -217,18 +225,15 @@ ul.phpdebugbar-widgets-timeline {
ul.phpdebugbar-widgets-timeline .phpdebugbar-widgets-measure {
height: 20px;
position: relative;
border-bottom: 1px solid #eee;
border: none;
display: block;
}
ul.phpdebugbar-widgets-timeline li:hover {
background: #fafafa;
}
ul.phpdebugbar-widgets-timeline li span.phpdebugbar-widgets-label,
ul.phpdebugbar-widgets-timeline li span.phpdebugbar-widgets-collector {
position: absolute;
font-size: 12px;
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
color: #555;
font-family: var(--debugbar-font-mono);
color: var(--debugbar-text);
top: 4px;
left: 5px;
background: none;
@ -243,22 +248,26 @@ ul.phpdebugbar-widgets-timeline {
ul.phpdebugbar-widgets-timeline li span.phpdebugbar-widgets-value {
display: block;
position: absolute;
height: 10px;
background: #3db9ec;
top: 5px;
border-radius: 2px;
min-width: 1px;
height: calc(100% - 4px);
background-color: var(--debugbar-accent);
border-bottom: 2px solid var(--debugbar-accent-border);
top: 2px;
border-radius: 3px;
min-width: 2px;
}
ul.phpdebugbar-widgets-timeline table.phpdebugbar-widgets-params {
display: none;
width: 70%;
margin: 10px;
border: 1px solid #ddd;
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
border: 1px solid var(--debugbar-border);
font-family: var(--debugbar-font-mono);
border-collapse: collapse;
}
ul.phpdebugbar-widgets-timeline table.phpdebugbar-widgets-params td {
border: 1px solid #ddd;
border: 1px solid var(--debugbar-border);
border-left: none ;
border-right: none;
padding: 0 5px;
}
ul.phpdebugbar-widgets-timeline table.phpdebugbar-widgets-params .phpdebugbar-widgets-name {
@ -288,8 +297,8 @@ div.phpdebugbar-widgets-exceptions li.phpdebugbar-widgets-list-item {
display: none;
margin: 10px;
padding: 5px;
border: 1px solid #ddd;
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
border: 1px solid var(--debugbar-border);
font-family: var(--debugbar-font-mono);
}
div.phpdebugbar-widgets-exceptions li.phpdebugbar-widgets-list-item span.phpdebugbar-widgets-filename {
@ -301,3 +310,4 @@ ul.phpdebugbar-widgets-timeline table.phpdebugbar-widgets-params {
border: 0;
width: 99%;
}

@ -53,7 +53,7 @@ if (typeof(PhpDebugBar) == 'undefined') {
if (typeof(hljs) === 'undefined') {
return htmlize(code);
}
if (lang) {
if (lang && hljs.getLanguage(lang)) {
return hljs.highlight(code, {language: lang}).value;
}
return hljs.highlightAuto(code).value;
@ -679,11 +679,15 @@ if (typeof(PhpDebugBar) == 'undefined') {
this.$actions = $('<div />').addClass(csscls('dataset-actions')).appendTo(this.$el);
var self = this;
var debugbar = self.get('debugbar');
this.$autoshow = $('<input type=checkbox>')
.on('click', function() {
if (self.get('debugbar').ajaxHandler) {
self.get('debugbar').ajaxHandler.setAutoShow($(this).is(':checked'));
if (debugbar.ajaxHandler) {
debugbar.ajaxHandler.setAutoShow($(this).is(':checked'));
}
if (debugbar.controls['__settings']) {
debugbar.controls['__settings'].get('widget').set('autoshow', this.autoShow);
}
});
@ -850,4 +854,5 @@ if (typeof(PhpDebugBar) == 'undefined') {
});
})(PhpDebugBar.$);

@ -7,6 +7,6 @@ div.phpdebugbar-widgets-mails li.phpdebugbar-widgets-list-item pre.phpdebugbar-w
display: none;
margin: 10px;
padding: 5px;
border: 1px solid #ddd;
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
border: 1px solid var(--debugbar-border);
font-family: var(--debugbar-font-mono);
}

@ -1,10 +1,10 @@
div.phpdebugbar-widgets-sqlqueries .phpdebugbar-widgets-status {
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
font-family: var(--debugbar-font-mono);
padding: 6px 6px;
border-bottom: 1px solid #ddd;
border-bottom: 1px solid var(--debugbar-border);
font-weight: bold;
color: #555;
background: #fafafa;
color: var(--debugbar-text);
background-color: var(--debugbar-background-alt);
}
div.phpdebugbar-widgets-sqlqueries li.phpdebugbar-widgets-list-item.phpdebugbar-widgets-error {
@ -19,7 +19,7 @@ div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-copy-clipboard,
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-stmt-id {
float: right;
margin-left: 8px;
color: #888;
color: var(--debugbar-text-muted);
}
div.phpdebugbar-widgets-sqlqueries div.phpdebugbar-widgets-status span.phpdebugbar-widgets-database,
div.phpdebugbar-widgets-sqlqueries div.phpdebugbar-widgets-status span.phpdebugbar-widgets-duration,
@ -27,7 +27,7 @@ div.phpdebugbar-widgets-sqlqueries div.phpdebugbar-widgets-status span.phpdebugb
div.phpdebugbar-widgets-sqlqueries div.phpdebugbar-widgets-status span.phpdebugbar-widgets-row-count,
div.phpdebugbar-widgets-sqlqueries div.phpdebugbar-widgets-status span.phpdebugbar-widgets-copy-clipboard,
div.phpdebugbar-widgets-sqlqueries div.phpdebugbar-widgets-status span.phpdebugbar-widgets-stmt-id {
color: #555;
color: var(--debugbar-text);
}
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-database:before,
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-duration:before,
@ -58,25 +58,28 @@ div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-stmt-id:before {
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-copy-clipboard:before {
content: "\f0c5";
}
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-copy-clipboard-check:before {
content: "\f46c";
}
div.phpdebugbar-widgets-sqlqueries a.phpdebugbar-widgets-editor-link:before {
content: "\f08e";
}
div.phpdebugbar-widgets-sqlqueries a.phpdebugbar-widgets-editor-link {
color: #888;
color: var(--debugbar-link);
}
div.phpdebugbar-widgets-sqlqueries a.phpdebugbar-widgets-editor-link:hover {
color: #aaaaaa;
color: var(--debugbar-hover);
}
div.phpdebugbar-widgets-sqlqueries table.phpdebugbar-widgets-params {
display: none;
width: 70%;
margin: 10px;
border: 1px solid #ddd;
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
border: 1px solid var(--debugbar-border);
font-family: var(--debugbar-font-mono);
border-collapse: collapse;
}
div.phpdebugbar-widgets-sqlqueries table.phpdebugbar-widgets-params td {
border: 1px solid #ddd;
border: 1px solid var(--debugbar-border);
text-align: center;
}
div.phpdebugbar-widgets-sqlqueries table.phpdebugbar-widgets-params .phpdebugbar-widgets-name {
@ -96,11 +99,11 @@ code.phpdebugbar-widgets-sql {
}
div.phpdebugbar-widgets-sqlqueries li.phpdebugbar-widgets-list-item.phpdebugbar-widgets-sql-duplicate {
background-color: #edeff0;
background-color: #F7EDED;
}
div.phpdebugbar-widgets-sqlqueries li.phpdebugbar-widgets-list-item.phpdebugbar-widgets-sql-duplicate:hover {
background-color: #ffc;
div.phpdebugbar[data-theme='dark'] div.phpdebugbar-widgets-sqlqueries li.phpdebugbar-widgets-list-item.phpdebugbar-widgets-sql-duplicate {
background-color: #473e00;
}
div.phpdebugbar-widgets-sqlqueries div.phpdebugbar-widgets-toolbar {
@ -123,8 +126,8 @@ div.phpdebugbar-widgets-sqlqueries div.phpdebugbar-widgets-toolbar a.phpdebugbar
text-decoration: none;
}
div.phpdebugbar-widgets-sqlqueries div.phpdebugbar-widgets-toolbar a.phpdebugbar-widgets-filter.phpdebugbar-widgets-excluded {
background: #eee;
color: #888;
background: var(--debugbar-background);
color: var(--debugbar-text);
}
div.phpdebugbar-widgets-sqlqueries a.phpdebugbar-widgets-duplicates {
font-weight: bold;
@ -133,6 +136,7 @@ div.phpdebugbar-widgets-sqlqueries a.phpdebugbar-widgets-duplicates {
div.phpdebugbar-widgets-sqlqueries li.phpdebugbar-widgets-list-item div.phpdebugbar-widgets-bg-measure {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
overflow: hidden;
@ -140,14 +144,16 @@ div.phpdebugbar-widgets-sqlqueries li.phpdebugbar-widgets-list-item div.phpdebug
}
div.phpdebugbar-widgets-sqlqueries div.phpdebugbar-widgets-bg-measure div.phpdebugbar-widgets-value {
position: absolute;
height: 100%;
opacity: 0.2;
background: red;
bottom: 0;
height: 1px;
opacity: 1;
background: var(--debugbar-accent-border);
}
div.phpdebugbar-widgets-sqlqueries td.phpdebugbar-widgets-value li.phpdebugbar-widgets-table-list-item {
text-align: left;
padding-left: 6px;
}
div.phpdebugbar-widgets-sqlqueries .phpdebugbar-text-muted {
color: #888;
color: var(--debugbar-text-muted);
}

@ -20,8 +20,12 @@
var code = $(el).parent('li').find('code').get(0);
var copy = function () {
try {
document.execCommand('copy');
alert('Query copied to the clipboard');
if (document.execCommand('copy')) {
$(el).addClass(csscls('copy-clipboard-check'));
setTimeout(function(){
$(el).removeClass(csscls('copy-clipboard-check'));
}, 2000)
}
} catch (err) {
console.log('Oops, unable to copy');
}
@ -116,10 +120,11 @@
li.addClass(csscls('error'));
li.append($('<span />').addClass(csscls('error')).text("[" + stmt.error_code + "] " + stmt.error_message));
}
if ((!stmt.type || stmt.type === 'query') && stmt.show_copy !== false) {
if ((!stmt.type || stmt.type === 'query')) {
$('<span title="Copy to clipboard" />')
.addClass(csscls('copy-clipboard'))
.css('cursor', 'pointer')
.html("&#8203;")
.on('click', function (event) {
self.onCopyToClipboard(this);
event.stopPropagation();

@ -1,11 +1,11 @@
div.phpdebugbar-widgets-templates div.phpdebugbar-widgets-status {
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
font-family: var(--debugbar-font-mono);
padding: 6px 6px;
border-bottom: 1px solid #ddd;
border-bottom: 1px solid var(--debugbar-border);
font-weight: bold;
color: #555;
background: #fafafa;
color: var(--debugbar-text);
background-color: var(--debugbar-background-alt);
}
div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-render-time,
@ -15,14 +15,14 @@ div.phpdebugbar-widgets-templates a.phpdebugbar-widgets-editor-link,
div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-type {
float: right;
margin-left: 8px;
color: #888;
color: var(--debugbar-text);
}
div.phpdebugbar-widgets-templates div.phpdebugbar-widgets-status span.phpdebugbar-widgets-render-time,
div.phpdebugbar-widgets-templates div.phpdebugbar-widgets-status span.phpdebugbar-widgets-memory,
div.phpdebugbar-widgets-templates div.phpdebugbar-widgets-status span.phpdebugbar-widgets-param-count,
div.phpdebugbar-widgets-templates div.phpdebugbar-widgets-status a.phpdebugbar-widgets-editor-link,
div.phpdebugbar-widgets-templates div.phpdebugbar-widgets-status span.phpdebugbar-widgets-type {
color: #555;
color: var(--debugbar-text);
}
div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-render-time:before,
div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-memory:before,
@ -37,7 +37,7 @@ div.phpdebugbar-widgets-templates a.phpdebugbar-widgets-editor-link:before
}
div.phpdebugbar-widgets-templates a.phpdebugbar-widgets-editor-link:hover
{
color: #aaaaaa;
color: var(--debugbar-hover);
}
div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-render-time:before {
content: "\f017";
@ -59,12 +59,12 @@ div.phpdebugbar-widgets-templates table.phpdebugbar-widgets-params {
display: none;
width: 70%;
margin: 10px;
border: 1px solid #ddd;
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
border: 1px solid var(--debugbar-border);
font-family: var(--debugbar-font-mono);
border-collapse: collapse;
}
div.phpdebugbar-widgets-templates table.phpdebugbar-widgets-params td {
border: 1px solid #ddd;
border: 1px solid var(--debugbar-border);
padding: 0 5px;
}
div.phpdebugbar-widgets-templates table.phpdebugbar-widgets-params .phpdebugbar-widgets-name {

@ -32,8 +32,8 @@ class DoctrineTest extends AbstractBrowserTest
return $node->getText();
});
$this->assertEquals('INSERT INTO products (name) VALUES (?)', $statements[1]);
$this->assertCount(4, $statements);
$this->assertEquals('INSERT INTO products (name, updated) VALUES (?, ?)', $statements[1]);
$this->assertCount(5, $statements);
}
}

@ -2,6 +2,7 @@
namespace DebugBar\Tests\Browser;
use Facebook\WebDriver\WebDriverDimension;
use Facebook\WebDriver\WebDriverElement;
class DebugbarTest extends AbstractBrowserTest
@ -9,6 +10,9 @@ class DebugbarTest extends AbstractBrowserTest
public function testDebugbarTab(): void
{
$client = static::createPantherClient();
$size = new WebDriverDimension(1920, 800);
$client->manage()->window()->setSize($size);
$crawler = $client->request('GET', '/demo/');
// Wait for Debugbar to load
@ -32,11 +36,54 @@ class DebugbarTest extends AbstractBrowserTest
// Close it again
$client->click($this->getTabLink($crawler, 'messages'));
$client->waitForInvisibility('.phpdebugbar-panel[data-collector=messages] .phpdebugbar-widgets-list');
$client->takeScreenshot(__DIR__ .'/../../../screenshots/minimized.png');
}
public function testDebugbarLightMode(): void
{
$client = static::createPantherClient();
$size = new WebDriverDimension(1920, 800);
$client->manage()->window()->setSize($size);
$crawler = $client->request('GET', '/demo/?theme=light');
// Wait for Debugbar to load
$crawler = $client->waitFor('.phpdebugbar-body');
usleep(1000);
if (!$this->isTabActive($crawler, 'messages')) {
$client->click($this->getTabLink($crawler, 'messages'));
}
$client->takeScreenshot(__DIR__ .'/../../../screenshots/light.png');
}
public function testDebugbarDarkMode(): void
{
$client = static::createPantherClient();
$size = new WebDriverDimension(1920, 800);
$client->manage()->window()->setSize($size);
$crawler = $client->request('GET', '/demo/?theme=dark');
// Wait for Debugbar to load
$crawler = $client->waitFor('.phpdebugbar-body');
usleep(1000);
if (!$this->isTabActive($crawler, 'messages')) {
$client->click($this->getTabLink($crawler, 'messages'));
}
$client->takeScreenshot(__DIR__ .'/../../../screenshots/dark.png');
}
public function testDebugbarAjax(): void
{
$client = static::createPantherClient();
$size = new WebDriverDimension(1920, 800);
$client->manage()->window()->setSize($size);
$crawler = $client->request('GET', '/demo/');
// Wait for Debugbar to load
@ -79,8 +126,7 @@ class DebugbarTest extends AbstractBrowserTest
$this->assertStringContainsString('GET /demo/ajax.php (ajax)', $requests[1]);
$this->assertStringContainsString('GET /demo/ajax_exception.php (ajax)', $requests[2]);
$client->takeScreenshot(__DIR__ .'/../../../screenshots/ajax.png');
}
}

@ -3,12 +3,15 @@
namespace DebugBar\Tests\Browser;
use DebugBar\Browser\Bridge\WebDriverElement;
use Facebook\WebDriver\WebDriverDimension;
class PdoTest extends AbstractBrowserTest
{
public function testMonologCollector(): void
{
$client = static::createPantherClient();
$size = new WebDriverDimension(1920, 800);
$client->manage()->window()->setSize($size);
$client->request('GET', '/demo/pdo.php');
@ -29,6 +32,9 @@ class PdoTest extends AbstractBrowserTest
$this->assertEquals('insert into users (name) values (?)', $statements[1]);
$this->assertCount(7, $statements);
$client->takeScreenshot(__DIR__ .'/../../../screenshots/pdo.png');
}
}

@ -147,6 +147,20 @@ class JavascriptRendererTest extends DebugBarTestCase
$this->assertStringStartsWith("<script type=\"text/javascript\" nonce=\"mynonce\">\nvar phpdebugbar = new PhpDebugBar.DebugBar();", $this->r->render());
}
public function testRenderConstructorWithEmptyTabsHidden()
{
$this->r->setInitialization(JavascriptRenderer::INITIALIZE_CONSTRUCTOR);
$this->r->setHideEmptyTabs(true);
$this->assertStringStartsWith("<script type=\"text/javascript\">\nvar phpdebugbar = new PhpDebugBar.DebugBar({\"hideEmptyTabs\":true});\n", $this->r->render());
}
public function testRenderConstructorWithTheme()
{
$this->r->setInitialization(JavascriptRenderer::INITIALIZE_CONSTRUCTOR);
$this->r->setTheme('dark');
$this->assertStringStartsWith("<script type=\"text/javascript\">\nvar phpdebugbar = new PhpDebugBar.DebugBar({\"theme\":\"dark\"});", $this->r->render());
}
public function testJQueryNoConflictAutoDisabling()
{
$this->assertTrue($this->r->isJqueryNoConflictEnabled());

@ -1,6 +1,6 @@
<?php
error_reporting(E_ALL | E_STRICT);
error_reporting(E_ALL);
date_default_timezone_set('Europe/London');
$loader = require(dirname(__DIR__) . '/vendor/autoload.php');