Skip to content
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

Improve php extensions method #367

Merged
merged 3 commits into from
Apr 9, 2022
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
7 changes: 3 additions & 4 deletions lib/PhpStatistics.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,9 @@ protected function getAPCuStatus(): array {
/**
* Get all loaded php extensions
*
* @return string as csv list of loaded extensions
* @return array of strings with the names of the loaded extensions
*/
protected function getLoadedPhpExtensions(): string {
$extensions = (function_exists('get_loaded_extensions') ? get_loaded_extensions() : ['Unable to list extensions']);
return implode(', ', $extensions);
protected function getLoadedPhpExtensions(): ?array {
return (function_exists('get_loaded_extensions') ? get_loaded_extensions() : null);
}
}
2 changes: 1 addition & 1 deletion templates/settings-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ class="barchart"
</p>
<p>
<?php p($l->t('Extensions:')); ?>
<em id="phpExtensions"><?php p($_['php']['extensions']); ?></em>
<em id="phpExtensions"><?php p($_['php']['extensions'] !== null ? implode(', ', $_['php']['extensions']) : $l->t('Unable to list extensions')); ?></em>
</p>
</div>
</div>
Expand Down