Skip to content

[FrameworkBundle] Remove env var table from AboutCommand #34768

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 26, 2019
Merged
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
22 changes: 0 additions & 22 deletions src/Symfony/Bundle/FrameworkBundle/Command/AboutCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
['Xdebug', \extension_loaded('xdebug') ? 'true' : 'false'],
];

if ($dotenv = self::getDotenvVars()) {
$rows = array_merge($rows, [
new TableSeparator(),
['<info>Environment (.env)</>'],
new TableSeparator(),
], array_map(function ($value, $name) {
return [$name, $value];
}, $dotenv, array_keys($dotenv)));
}

$io->table([], $rows);

return 0;
Expand Down Expand Up @@ -129,16 +119,4 @@ private static function isExpired(string $date): bool

return false !== $date && new \DateTime() > $date->modify('last day of this month 23:59:59');
}

private static function getDotenvVars(): array
{
$vars = [];
foreach (explode(',', $_SERVER['SYMFONY_DOTENV_VARS'] ?? $_ENV['SYMFONY_DOTENV_VARS'] ?? '') as $name) {
if ('' !== $name && isset($_ENV[$name])) {
$vars[$name] = $_ENV[$name];
}
}

return $vars;
}
}