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

List php extensions #329

Merged
merged 2 commits into from
Apr 1, 2022
Merged

Conversation

R0Wi
Copy link
Member

@R0Wi R0Wi commented Sep 25, 2021

In many situations it's good to know which php extensions are enabled in the current setup. Usually one would look this up in phpinfo page but this one is not included in NC, so i thought it would be nice to add this info to the serverinfo page?

@R0Wi R0Wi force-pushed the feature/list-php-extensions branch from 19d4b3e to 7baa682 Compare September 25, 2021 11:49
@R0Wi R0Wi force-pushed the feature/list-php-extensions branch from 7baa682 to 883b825 Compare September 25, 2021 11:50
@R0Wi
Copy link
Member Author

R0Wi commented Sep 25, 2021

Sorry did some mistake, rebased on master 👍

lib/PhpStatistics.php Outdated Show resolved Hide resolved
Copy link
Member Author

@R0Wi R0Wi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@come-nc come-nc merged commit 1b9a49f into nextcloud:master Apr 1, 2022
@R0Wi R0Wi deleted the feature/list-php-extensions branch April 1, 2022 12:50
* @return string as csv list of loaded extensions
*/
protected function getLoadedPhpExtensions(): string {
$extensions = (function_exists('get_loaded_extensions') ? get_loaded_extensions() : ['Unable to list extensions']);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getLoadedPhpExtensions should probably return the list of extensions directly and fallback to null if the function doesn't exist, and we would do the implode part inside the template.

This would allow this function to be reusable elsewhere and the 'Unable to list extensions' message being translatable without injecting I10N into this class.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds cleaner to me, too. Shall i implement this task as separate PR? Or anyone else interested?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, please open a new PR. :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done at #367

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants