cpu_info();
$ar_buf = finddups($sysinfo->pci());
if (count($ar_buf)) {
for ($i = 0, $max = sizeof($ar_buf); $i < $max; $i++) {
if ($ar_buf[$i]) {
$pci_devices .= " " . htmlspecialchars(chop($ar_buf[$i]), ENT_QUOTES) . "\n";
}
}
}
$ar_buf = $sysinfo->ide();
ksort($ar_buf);
if (count($ar_buf)) {
while (list($key, $value) = each($ar_buf)) {
$ide_devices .= " \n" . htmlspecialchars($key . ': ' . $ar_buf[$key]['model'], ENT_QUOTES) . "\n";
if (isset($ar_buf[$key]['capacity'])) {
$ide_devices .= '' . htmlspecialchars($ar_buf[$key]['capacity'], ENT_QUOTES) . '';
}
$hddtemp_devices[] = $key;
$ide_devices .= "\n";
}
}
$ar_buf = $sysinfo->scsi();
ksort($ar_buf);
if (count($ar_buf)) {
while (list($key, $value) = each($ar_buf)) {
$scsi_devices .= "\n";
if ($key >= '0' && $key <= '9') {
$scsi_devices .= " " . htmlspecialchars($ar_buf[$key]['model'], ENT_QUOTES) . "\n";
} else {
$scsi_devices .= " " . htmlspecialchars($key . ': ' . $ar_buf[$key]['model'], ENT_QUOTES) . "\n";
}
if (isset($ar_buf[$key]['capacity'])) {
$scsi_devices .= '' . htmlspecialchars($ar_buf[$key]['capacity'], ENT_QUOTES) . '';
}
$scsi_devices .= "\n";
}
}
$ar_buf = finddups( $sysinfo->usb() );
if (count($ar_buf)) {
for ($i = 0, $max = sizeof($ar_buf); $i < $max; $i++) {
if ($ar_buf[$i]) {
$usb_devices .= " " . htmlspecialchars(chop($ar_buf[$i]), ENT_QUOTES) . "\n";
}
}
}
/* disabled since we output this information
$ar_buf = $sysinfo->sbus();
if (count($ar_buf)) {
for ($i = 0, $max = sizeof($ar_buf); $i < $max; $i++) {
if ($ar_buf[$i]) {
$sbus_devices .= " " . htmlspecialchars(chop($ar_buf[$i]), ENT_QUOTES) . "\n";
}
}
}
*/
$_text = " \n";
$_text .= " \n";
if (isset($sys['cpus'])) {
$_text .= " " . htmlspecialchars($sys['cpus'], ENT_QUOTES) . "\n";
}
if (isset($sys['model'])) {
$_text .= " " . htmlspecialchars($sys['model'], ENT_QUOTES) . "\n";
}
if (isset($sys['cpuspeed'])) {
$_text .= " " . htmlspecialchars($sys['cpuspeed'], ENT_QUOTES) . "\n";
}
if (isset($sys['busspeed'])) {
$_text .= " " . htmlspecialchars($sys['busspeed'], ENT_QUOTES) . "\n";
}
if (isset($sys['cache'])) {
$_text .= " " . htmlspecialchars($sys['cache'], ENT_QUOTES) . "\n";
}
if (isset($sys['bogomips'])) {
$_text .= " " . htmlspecialchars($sys['bogomips'], ENT_QUOTES) . "\n";
}
$_text .= " \n";
$_text .= " \n";
if ($pci_devices) {
$_text .= $pci_devices;
}
$_text .= " \n";
$_text .= " \n";
if ($ide_devices) {
$_text .= $ide_devices;
}
$_text .= " \n";
$_text .= " \n";
if ($scsi_devices) {
$_text .= $scsi_devices;
}
$_text .= " \n";
$_text .= " \n";
if ($usb_devices) {
$_text .= $usb_devices;
}
$_text .= " \n";
/*
$_text .= " \n";
if ($sbus_devices) {
$_text .= $sbus_devices;
}
$_text .= " \n";
*/
$_text .= " \n";
return $_text;
}
function html_hardware ()
{
global $XPath;
global $text;
$pci_devices = ""; $ide_devices = ""; $usb_devices = ""; $scsi_devices = "";
$textdir = direction();
for ($i = 1, $max = sizeof($XPath->getDataParts('/phpsysinfo/Hardware/PCI')); $i < $max; $i++) {
if ($XPath->match("/phpsysinfo/Hardware/PCI/Device[$i]/Name")) {
$pci_devices .= "
- | " . $XPath->getData("/phpsysinfo/Hardware/PCI/Device[$i]/Name") . " |
";
}
}
for ($i = 1, $max = sizeof($XPath->getDataParts('/phpsysinfo/Hardware/IDE')); $i < $max; $i++) {
if ($XPath->match("/phpsysinfo/Hardware/IDE/Device[$i]")) {
$ide_devices .= "- | " . $XPath->getData("/phpsysinfo/Hardware/IDE/Device[$i]/Name");
if ($XPath->match("/phpsysinfo/Hardware/IDE/Device[$i]/Capacity")) {
$ide_devices .= " (" . $text['capacity'] . ": " . format_bytesize($XPath->getData("/phpsysinfo/Hardware/IDE/Device[$i]/Capacity") / 2) . ")";
}
$ide_devices .= " |
";
}
}
for ($i = 1, $max = sizeof($XPath->getDataParts('/phpsysinfo/Hardware/SCSI')); $i < $max; $i++) {
if ($XPath->match("/phpsysinfo/Hardware/SCSI/Device[$i]")) {
$scsi_devices .= "- | " . $XPath->getData("/phpsysinfo/Hardware/SCSI/Device[$i]/Name");
if ($XPath->match("/phpsysinfo/Hardware/SCSI/Device[$i]/Capacity")) {
$scsi_devices .= " (" . $text['capacity'] . ": " . format_bytesize($XPath->getData("/phpsysinfo/Hardware/SCSI/Device[$i]/Capacity") / 2) . ")";
}
$scsi_devices .= " |
";
}
}
for ($i = 1, $max = sizeof($XPath->getDataParts('/phpsysinfo/Hardware/USB')); $i < $max; $i++) {
if ($XPath->match("/phpsysinfo/Hardware/USB/Device[$i]/Name")) {
$usb_devices .= "- | " . $XPath->getData("/phpsysinfo/Hardware/USB/Device[$i]/Name") . " |
";
}
}
$_text = "\n";
if ($XPath->match("/phpsysinfo/Hardware/CPU/Number")) {
$_text .= " \n " . $text['numcpu'] . " | \n " . $XPath->getData("/phpsysinfo/Hardware/CPU/Number") . " | \n
\n";
}
if ($XPath->match("/phpsysinfo/Hardware/CPU/Model")) {
$_text .= " \n " . $text['cpumodel'] . " | \n " . $XPath->getData("/phpsysinfo/Hardware/CPU/Model") . " | \n
\n";
}
if ($XPath->match("/phpsysinfo/Hardware/CPU/Cpuspeed")) {
$tmp_speed = $XPath->getData("/phpsysinfo/Hardware/CPU/Cpuspeed");
if ($tmp_speed < 1000) {
$_text .= " \n " . $text['cpuspeed'] . " | \n " . $tmp_speed . " MHz | \n
\n";
} else {
$_text .= " \n " . $text['cpuspeed'] . " | \n " . round($tmp_speed / 1000, 2) . " GHz | \n
\n";
}
}
if ($XPath->match("/phpsysinfo/Hardware/CPU/Busspeed")) {
$tmp_speed = $XPath->getData("/phpsysinfo/Hardware/CPU/Busspeed");
if ($tmp_speed < 1000) {
$_text .= " \n " . $text['busspeed'] . " | \n " . $tmp_speed . " MHz | \n
\n";
} else {
$_text .= " \n " . $text['busspeed'] . " | \n " . round($tmp_speed / 1000, 2) . " GHz | \n
\n";
}
}
if ($XPath->match("/phpsysinfo/Hardware/CPU/Cache")) {
$_text .= " \n " . $text['cache'] . " | \n " . $XPath->getData("/phpsysinfo/Hardware/CPU/Cache") . " | \n
\n";
}
if ($XPath->match("/phpsysinfo/Hardware/CPU/Bogomips")) {
$_text .= " \n " . $text['bogomips'] . " | \n " . $XPath->getData("/phpsysinfo/Hardware/CPU/Bogomips") . " | \n
\n";
}
$_text .= " \n " . $text['pci'] . " | \n ";
if ($pci_devices) {
$_text .= "";
} else {
$_text .= "" . $text['none'] . "";
}
$_text .= " | \n
\n";
$_text .= " \n " . $text['ide'] . " | \n ";
if ($ide_devices) {
$_text .= "";
} else {
$_text .= "" . $text['none'] . "";
}
$_text .= " | \n
\n";
if ($scsi_devices) {
$_text .= " \n " . $text['scsi'] . " | \n | \n
";
}
if ($usb_devices) {
$_text .= " \n " . $text['usb'] . " | \n | \n
";
}
$_text .= "
";
return $_text;
}
?>