Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Symfony/Bundle/WebProfilerBundle/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ CHANGELOG

* Add support for the `QUERY` HTTP method in the profiler
* Add support for Server-Sent Events / `EventSource` requests in the debug toolbar
* Add support for displaying the application runner class

7.3
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@
</span>
</div>

{% if collector.runner is defined and collector.runner is not null %}
<div class="sf-toolbar-info-piece sf-toolbar-info-runner">
<b>Runner</b>
<span>{{ collector.runner|abbr_class }}</span>
</div>
{% endif %}

{% if 'n/a' is not same as(collector.env) %}
<div class="sf-toolbar-info-piece">
<b>Environment</b>
Expand Down Expand Up @@ -170,6 +177,15 @@
{% block panel %}
<h2>Symfony Configuration</h2>

{% if collector.runner is defined and collector.runner is not null %}
<div class="metrics">
<div class="metric">
<span class="value">{{ collector.runner|abbr_class }}</span>
<span class="label">Runner</span>
</div>
</div>
{% endif %}

<div class="metrics">
<div class="metric">
<span class="value">
Expand Down
1 change: 1 addition & 0 deletions src/Symfony/Component/HttpKernel/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ CHANGELOG
* Deprecate implementing `__sleep/wakeup()` on data collectors; use `__(un)serialize()` instead
* Add `#[IsSignatureValid]` attribute to validate URI signatures
* Make `Profile` final and `Profiler::__sleep()` internal
* Collect the application runner class

7.3
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\Runtime\RunnerInterface;
use Symfony\Component\VarDumper\Caster\ClassStub;
use Symfony\Component\VarDumper\Cloner\Data;

Expand Down Expand Up @@ -64,6 +65,7 @@ public function collect(Request $request, Response $response, ?\Throwable $excep
'zend_opcache_status' => \extension_loaded('Zend OPcache') ? (filter_var(\ini_get('opcache.enable'), \FILTER_VALIDATE_BOOLEAN) ? 'Enabled' : 'Not enabled') : 'Not installed',
'bundles' => [],
'sapi_name' => \PHP_SAPI,
'runner_class' => $this->determineRunnerClass(),
];

if (isset($this->kernel)) {
Expand Down Expand Up @@ -249,6 +251,11 @@ public function getSapiName(): string
return $this->data['sapi_name'];
}

public function getRunnerClass(): ?string
{
return $this->data['runner_class'];
}

public function getName(): string
{
return 'config';
Expand All @@ -272,4 +279,19 @@ private function determineSymfonyState(): string

return $versionState;
}

private function determineRunnerClass(): ?string
{
$stack = debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS);
for ($frame = end($stack); $frame; $frame = prev($stack)) {
if (!$class = $frame['class'] ?? null) {
continue;
}
if (is_a($class, RunnerInterface::class, true)) {
return $class;
}
}

return null;
}
}
Loading