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

Rewrite getMemory / getCPUName / getUptime #183

Merged
merged 8 commits into from
Apr 14, 2020
Merged

Conversation

kesselb
Copy link
Collaborator

@kesselb kesselb commented Mar 15, 2020

  • Fix wrong namespace
  • Use file_get_contents instead of shell_exec for uptime, hostname, cpu name, memory info
  • FormatBytes expected kB instead of byte.
  • Make parsing testable

@kesselb kesselb added this to the Nextcloud 19 milestone Mar 15, 2020
@kesselb kesselb force-pushed the enh/noid/proc-getmemory branch 2 times, most recently from 219b417 to 07880cc Compare March 15, 2020 20:28
@kesselb kesselb mentioned this pull request Mar 16, 2020
@kesselb kesselb changed the title Rewrite getMemory Rewrite getMemory / getCPUName / getUptime Mar 16, 2020
I don't know why php does not complain but phpunit were not able to locate the files.

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Don't use shell_exec to fetch that information anymore, Make it testable

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
I guess the confusion was the df -TP already returns the values as kB instead of bytes hence we have to multiply the values first before we pass them to FormatBytes.

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
@rullzer rullzer mentioned this pull request Apr 4, 2020
80 tasks
@kesselb kesselb marked this pull request as ready for review April 4, 2020 19:59
# Conflicts:
#	lib/OperatingSystems/DefaultOs.php
#	templates/settings-admin.php
@rullzer rullzer mentioned this pull request Apr 9, 2020
59 tasks
@rullzer rullzer merged commit 310f821 into master Apr 14, 2020
@delete-merged-branch delete-merged-branch bot deleted the enh/noid/proc-getmemory branch April 14, 2020 19:02
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.

2 participants