Skip to content

Commit

Permalink
Replace usage of commons.io function with the newly added function
Browse files Browse the repository at this point in the history
  • Loading branch information
hafizrahman committed Dec 5, 2024
1 parent 58c3a29 commit 0b5a08d
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ package com.woocommerce.android.extensions

import androidx.core.text.HtmlCompat
import com.woocommerce.android.util.WooLog
import org.apache.commons.io.FileUtils.byteCountToDisplaySize
import org.json.JSONArray
import org.json.JSONException
import org.json.JSONObject
Expand Down Expand Up @@ -110,7 +109,7 @@ private fun formatEnvironmentData(data: JSONObject): String {

val memoryLimit = data.optString("wp_memory_limit", MISSING_VALUE)
if (memoryLimit != MISSING_VALUE) {
sb.append("WP Memory Limit: ${byteCountToDisplaySize(memoryLimit.toLong())}\n")
sb.append("WP Memory Limit: ${memoryLimit.readableFileSize()}\n")
}

sb.append("WP Debug Mode: ${checkIfTrue(data.optBoolean("wp_debug_mode", false))}\n")
Expand All @@ -123,7 +122,7 @@ private fun formatEnvironmentData(data: JSONObject): String {

val postMaxSize = data.optString("php_post_max_size", MISSING_VALUE)
if (postMaxSize != MISSING_VALUE) {
sb.append("PHP Post Max Size: ${byteCountToDisplaySize(postMaxSize.toLong())}\n")
sb.append("WP Memory Limit: ${postMaxSize.readableFileSize()}\n")
}

sb.append("PHP Time Limit: ${data.optString("php_max_execution_time", MISSING_VALUE)} s\n")
Expand All @@ -134,7 +133,7 @@ private fun formatEnvironmentData(data: JSONObject): String {

val maxUploadSize = data.optString("max_upload_size", MISSING_VALUE)
if (maxUploadSize != MISSING_VALUE) {
sb.append("PHP Post Max Size: ${byteCountToDisplaySize(maxUploadSize.toLong())}\n")
sb.append("WP Memory Limit: ${maxUploadSize.readableFileSize()}\n")
}

sb.append("Default Timezone: ${data.optString("default_timezone", MISSING_VALUE)}\n")
Expand Down

0 comments on commit 0b5a08d

Please sign in to comment.