From fe12b5e385c0a9e70a6abf2ff271528daf432b63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=20Fl=C3=ADdr?= Date: Fri, 10 Jan 2025 14:50:50 +0100 Subject: [PATCH] Compatible code for deprecated `\Tracy\Debugger::VERSION`. --- changelog.md | 5 ++--- src/MvcCore/Ext/Debugs/Tracys/DbPanel.php | 5 ++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/changelog.md b/changelog.md index 80579c2..640a8e5 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,2 @@ -### Fixed -- Compatibility fix for `tracy/tracy` package and it's method renamed: - `\Tracy\Helpers::getNonce()` => `getNonceAttr()`. \ No newline at end of file +### Fixed +- Compatible code for deprecated `\Tracy\Debugger::VERSION`. \ No newline at end of file diff --git a/src/MvcCore/Ext/Debugs/Tracys/DbPanel.php b/src/MvcCore/Ext/Debugs/Tracys/DbPanel.php index 86d48dc..5b439b3 100644 --- a/src/MvcCore/Ext/Debugs/Tracys/DbPanel.php +++ b/src/MvcCore/Ext/Debugs/Tracys/DbPanel.php @@ -120,7 +120,10 @@ public function getTab () { public function getPanel () { $this->prepareQueriesData(); if ($this->queriesCount === 0) return $this->debugCode; - $nonce = version_compare(\Tracy\Debugger::Version, '2.10.8', '>=') + $tracyVersion = defined("\\Tracy\\Debugger::Version") + ? \Tracy\Debugger::Version + : \Tracy\Debugger::VERSION; + $nonce = version_compare($tracyVersion, '2.10.8', '>=') ? \Tracy\Helpers::getNonceAttr() : \Tracy\Helpers::getNonce(); $this->nonceAttr = $nonce ? ' nonce="' . \Tracy\Helpers::escapeHtml($nonce) . '"' : '';