memory(); $_text = " \n" . " " . htmlspecialchars($mem['ram']['t_free'], ENT_QUOTES) . "\n" . " " . htmlspecialchars($mem['ram']['t_used'], ENT_QUOTES) . "\n" . " " . htmlspecialchars($mem['ram']['total'], ENT_QUOTES) . "\n" . " " . htmlspecialchars($mem['ram']['percent'], ENT_QUOTES) . "\n"; if (isset($mem['ram']['app_percent'])) $_text .= " " . htmlspecialchars($mem['ram']['app'], ENT_QUOTES) . "\n " . htmlspecialchars($mem['ram']['app_percent'], ENT_QUOTES) . "\n"; if (isset($mem['ram']['buffers_percent'])) $_text .= " " . htmlspecialchars($mem['ram']['buffers'], ENT_QUOTES) . "\n " . htmlspecialchars($mem['ram']['buffers_percent'], ENT_QUOTES) . "\n"; if (isset($mem['ram']['cached_percent'])) $_text .= " " . htmlspecialchars($mem['ram']['cached'], ENT_QUOTES) . "\n " . htmlspecialchars($mem['ram']['cached_percent'], ENT_QUOTES) . "\n"; $_text .= " \n" . " \n" . " " . htmlspecialchars($mem['swap']['free'], ENT_QUOTES) . "\n" . " " . htmlspecialchars($mem['swap']['used'], ENT_QUOTES) . "\n" . " " . htmlspecialchars($mem['swap']['total'], ENT_QUOTES) . "\n" . " " . htmlspecialchars($mem['swap']['percent'], ENT_QUOTES) . "\n" . " \n" . " \n"; $i = 0; foreach ($mem['devswap'] as $device) { $_text .=" \n" . " " . htmlspecialchars($i++, ENT_QUOTES) . "\n" . " Swap" . " " . htmlspecialchars($device['dev'], ENT_QUOTES) . "\n" . " " . htmlspecialchars($device['percent'], ENT_QUOTES) . "\n" . " " . htmlspecialchars($device['free'], ENT_QUOTES) . "\n" . " " . htmlspecialchars($device['used'], ENT_QUOTES) . "\n" . " " . htmlspecialchars($device['total'], ENT_QUOTES) . "\n" . " \n"; } $_text .= " \n"; return $_text; } // // xml_memory() // function html_memory () { global $XPath; global $text; $textdir = direction(); $scale_factor = 2; $ram = create_bargraph($XPath->getData("/phpsysinfo/Memory/Used"), $XPath->getData("/phpsysinfo/Memory/Total"), $scale_factor); $ram .= "  " . $XPath->getData("/phpsysinfo/Memory/Percent") . "% "; $swap = create_bargraph($XPath->getData("/phpsysinfo/Swap/Used"), $XPath->getData("/phpsysinfo/Swap/Total"), $scale_factor); $swap .= "  " . $XPath->getData("/phpsysinfo/Swap/Percent") . "% "; if ($XPath->match("/phpsysinfo/Memory/AppPercent")) { $app = create_bargraph($XPath->getData("/phpsysinfo/Memory/App"), $XPath->getData("/phpsysinfo/Memory/Total"), $scale_factor); $app .= "  " . $XPath->getData("/phpsysinfo/Memory/AppPercent") . "% "; } if ($XPath->match("/phpsysinfo/Memory/BuffersPercent")) { $buffers = create_bargraph($XPath->getData("/phpsysinfo/Memory/Buffers"), $XPath->getData("/phpsysinfo/Memory/Total"), $scale_factor); $buffers .= "  " . $XPath->getData("/phpsysinfo/Memory/BuffersPercent") . "% "; } if ($XPath->match("/phpsysinfo/Memory/CachedPercent")) { $cached = create_bargraph($XPath->getData("/phpsysinfo/Memory/Cached"), $XPath->getData("/phpsysinfo/Memory/Total"), $scale_factor); $cached .= "  " . $XPath->getData("/phpsysinfo/Memory/CachedPercent") . "% "; } $_text = "\n" . " \n" . " \n" . " \n" . " \n" . " \n" . " \n" . " \n" . " \n" . " \n" . " \n" . " \n" . " \n" . " \n" . " \n"; if (isset($app)) { $_text .= " \n" . " \n" . " \n" . " \n" . " \n" . " \n" . " \n"; } if (isset($buffers)) { $_text .= " \n" . " \n" . " \n" . " \n" . " \n" . " \n" . " \n"; } if (isset($cached)) { $_text .= " \n" . " \n" . " \n" . " \n" . " \n" . " \n" . " \n"; } $_text .= " \n" . " \n" . " \n" . " \n" . " \n" . " \n" . " \n"; if (($max = sizeof($XPath->getDataParts("/phpsysinfo/Swapdevices"))) > 2) { for($i = 1; $i < $max; $i++) { $swapdev = create_bargraph($XPath->getData("/phpsysinfo/Swapdevices/Mount[$i]/Used"), $XPath->getData("/phpsysinfo/Swapdevices/Mount[$i]/Size"), $scale_factor); $swapdev .= "  " . $XPath->getData("/phpsysinfo/Swapdevices/Mount[$i]/Percent") . "% "; $_text .= " \n" . " \n" . " \n" . " \n" . " \n" . " \n" . " \n"; } } $_text .= "
" . $text['type'] . "" . $text['percent'] . "" . $text['free'] . "" . $text['used'] . "" . $text['size'] . "
" . $text['phymem'] . "" . $ram . "" . format_bytesize($XPath->getData("/phpsysinfo/Memory/Free")) . "" . format_bytesize($XPath->getData("/phpsysinfo/Memory/Used")) . "" . format_bytesize($XPath->getData("/phpsysinfo/Memory/Total")) . "
- " . $text['app'] . "" . $app . " " . format_bytesize($XPath->getData("/phpsysinfo/Memory/App")) . " 
- " . $text['buffers'] . "" . $buffers . " " . format_bytesize($XPath->getData("/phpsysinfo/Memory/Buffers")) . " 
- " . $text['cached'] . "" . $cached . " " . format_bytesize($XPath->getData("/phpsysinfo/Memory/Cached")) . " 
" . $text['swap'] . "" . $swap . "" . format_bytesize($XPath->getData("/phpsysinfo/Swap/Free")) . "" . format_bytesize($XPath->getData("/phpsysinfo/Swap/Used")) . "" . format_bytesize($XPath->getData("/phpsysinfo/Swap/Total")) . "
- " . $XPath->getData("/phpsysinfo/Swapdevices/Mount[$i]/Device/Name") . "" . $swapdev . "" . format_bytesize($XPath->getData("/phpsysinfo/Swapdevices/Mount[$i]/Free")) . "" . format_bytesize($XPath->getData("/phpsysinfo/Swapdevices/Mount[$i]/Used")) . "" . format_bytesize($XPath->getData("/phpsysinfo/Swapdevices/Mount[$i]/Size")) . "
"; return $_text; } function wml_memory() { global $XPath; global $text; $_text = "\n" . "

" . $text['phymem'] . ":
\n" . "- " . $text['free'] . ": " . format_bytesize($XPath->getData("/phpsysinfo/Memory/Free")) . "
\n" . "- " . $text['used'] . ": " . format_bytesize($XPath->getData("/phpsysinfo/Memory/Used")) . "
\n" . "- " . $text['size'] . ": " . format_bytesize($XPath->getData("/phpsysinfo/Memory/Total")) . "

\n"; if ($XPath->match("/phpsysinfo/Memory/App")) { $_text .= "

" . $text['app'] . ":
\n" . "- " . $text['used'] . ": " . format_bytesize($XPath->getData("/phpsysinfo/Memory/App")) . "

\n"; } if ($XPath->match("/phpsysinfo/Memory/Cached")) { $_text .= "

" . $text['cached'] . ":
\n" . "- " . $text['used'] . ": " . format_bytesize($XPath->getData("/phpsysinfo/Memory/Cached")) . "

\n"; } if ($XPath->match("/phpsysinfo/Memory/Buffers")) { $_text .= "

" . $text['buffers'] . ":
\n" . "- " . $text['used'] . ": " . format_bytesize($XPath->getData("/phpsysinfo/Memory/Buffers")) . "

\n"; } $_text .= "


" . $text['swap'] . ":
\n" . "- " . $text['free'] . ": " . format_bytesize($XPath->getData("/phpsysinfo/Swap/Free")) . "
\n" . "- " . $text['used'] . ": " . format_bytesize($XPath->getData("/phpsysinfo/Swap/Used")) . "
\n" . "- " . $text['size'] . ": " . format_bytesize($XPath->getData("/phpsysinfo/Swap/Total")) . "

\n"; $_text .= "
\n"; return $_text; } ?>