summaryrefslogtreecommitdiff
path: root/libs/memory.php
diff options
context:
space:
mode:
Diffstat (limited to 'libs/memory.php')
-rw-r--r--libs/memory.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/libs/memory.php b/libs/memory.php
index 81d9ac9..a4eda7b 100644
--- a/libs/memory.php
+++ b/libs/memory.php
@@ -1,5 +1,5 @@
<?php
-require 'Utils/Misc.class.php';
+require '../autoload.php';
$free = 0;
@@ -22,7 +22,9 @@ if (!($total = shell_exec('grep MemTotal /proc/meminfo | awk \'{print $2}\'')))
$used = $total - $free;
// Percent used
-$percent_used = 100 - (round($free / $total * 100));
+$percent_used = 0;
+if ($total > 0)
+ $percent_used = 100 - (round($free / $total * 100));
$datas = array(