Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,15 @@
{% endif %}

<h3>Server Parameters</h3>
{{ include('@WebProfiler/Profiler/bag.html.twig', { bag: collector.requestserver }, with_context = false) }}
<h4>Defined in .env</h4>
{{ include('@WebProfiler/Profiler/bag.html.twig', { bag: collector.dotenvvars }, with_context = false) }}

<h4>Defined as regular env variables</h4>
{% set requestserver = [] %}
{% for key, value in collector.requestserver if key not in collector.dotenvvars.keys %}
{% set requestserver = requestserver|merge({(key): value}) %}
{% endfor %}
{{ include('@WebProfiler/Profiler/table.html.twig', { data: requestserver }, with_context = false) }}
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ public function collect(Request $request, Response $response, \Exception $except
$responseCookies[$cookie->getName()] = $cookie;
}

$dotenvVars = array();
foreach (explode(',', getenv('SYMFONY_DOTENV_VARS')) as $name) {
if ('' !== $name && false !== $value = getenv($name)) {
$dotenvVars[$name] = $value;
}
}

$this->data = array(
'method' => $request->getMethod(),
'format' => $request->getRequestFormat(),
Expand All @@ -100,6 +107,7 @@ public function collect(Request $request, Response $response, \Exception $except
'path_info' => $request->getPathInfo(),
'controller' => 'n/a',
'locale' => $request->getLocale(),
'dotenv_vars' => $dotenvVars,
);

if (isset($this->data['request_headers']['php-auth-pw'])) {
Expand Down Expand Up @@ -254,6 +262,11 @@ public function getLocale()
return $this->data['locale'];
}

public function getDotenvVars()
{
return new ParameterBag($this->data['dotenv_vars']->getValue());
}

/**
* Gets the route name.
*
Expand Down