Skip to content

Commit

Permalink
Merge pull request #367 from R0Wi/feature/list-php-extension-v2
Browse files Browse the repository at this point in the history
Improve php extensions method
  • Loading branch information
R0Wi authored Apr 9, 2022
2 parents c4353df + ce3f41b commit b848ac5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
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

0 comments on commit b848ac5

Please sign in to comment.