Skip to content

Commit

Permalink
Merge branch '2' into 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli committed Feb 8, 2024
2 parents 40ec35e + 9a590fa commit 01a6e4c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
8 changes: 8 additions & 0 deletions code/DebugBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
use LeKoala\DebugBar\Collector\SilverStripeCollector;
use SilverStripe\Config\Collections\DeltaConfigCollection;
use SilverStripe\Config\Collections\CachedConfigCollection;
use SilverStripe\Dev\Deprecation;

/**
* A simple helper
Expand Down Expand Up @@ -402,6 +403,13 @@ public static function renderDebugBar()
$initialize = false;
}

// Normally deprecation notices are output in a shutdown function, which runs well after debugbar has rendered.
// This ensures the deprecation notices which have been noted up to this point are logged out and collected by
// the MonologCollector.
if (method_exists(Deprecation::class, 'outputNotices')) {
Deprecation::outputNotices();
}

$script = self::$renderer->render($initialize);
return $script;
}
Expand Down
16 changes: 11 additions & 5 deletions code/Extension/ProxyDBExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,15 +197,21 @@ protected static function findSource()
);

$sources = array();
foreach ($traces as $trace) {
foreach ($traces as $i => $trace) {
// We need to be able to look ahead one item in the trace, because the class/function values
// are talking about what is being *called* on this line, not the function this line lives in.
if (!isset($traces[$i+1])) {
break;
}

$file = isset($trace['file']) ? pathinfo($trace['file'], PATHINFO_FILENAME) : null;
$class = isset($trace['class']) ? $trace['class'] : null;
$class = isset($traces[$i+1]['class']) ? $traces[$i+1]['class'] : null;
$line = isset($trace['line']) ? $trace['line'] : null;
$function = isset($trace['function']) ? $trace['function'] : null;
$type = isset($trace['type']) ? $trace['type'] : '::';
$function = isset($traces[$i+1]['function']) ? $traces[$i+1]['function'] : null;
$type = isset($traces[$i+1]['type']) ? $traces[$i+1]['type'] : '::';

/* @var $object SSViewer */
$object = isset($trace['object']) ? $trace['object'] : null;
$object = isset($traces[$i+1]['object']) ? $traces[$i+1]['object'] : null;

if (in_array($class, $internalClasses)) {
continue;
Expand Down

0 comments on commit 01a6e4c

Please sign in to comment.