Skip to content

Commit

Permalink
Compatible code for deprecated \Tracy\Debugger::VERSION.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomFlidr committed Jan 10, 2025
1 parent cb0bccd commit fe12b5e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 2 additions & 3 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
### Fixed
- Compatibility fix for `tracy/tracy` package and it's method renamed:
`\Tracy\Helpers::getNonce()` => `getNonceAttr()`.
### Fixed
- Compatible code for deprecated `\Tracy\Debugger::VERSION`.
5 changes: 4 additions & 1 deletion src/MvcCore/Ext/Debugs/Tracys/DbPanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) . '"' : '';
Expand Down

0 comments on commit fe12b5e

Please sign in to comment.