Line 61... |
Line 61... |
61 |
* @var string
|
61 |
* @var string
|
62 |
*/
|
62 |
*/
|
63 |
private $_systeminfo = null;
|
63 |
private $_systeminfo = null;
|
64 |
|
64 |
|
65 |
/**
|
65 |
/**
|
66 |
* holds the COM object that we pull all the WMI data from
|
66 |
* holds the COM object that we pull WMI root\CIMv2 data from
|
67 |
*
|
67 |
*
|
68 |
* @var Object
|
68 |
* @var Object
|
69 |
*/
|
69 |
*/
|
70 |
private $_wmi = null;
|
70 |
private $_wmi = null;
|
71 |
|
71 |
|
72 |
/**
|
72 |
/**
|
73 |
* holds the COM object that we pull all the RegRead data from
|
73 |
* holds the COM object that we pull all the EnumKey and RegRead data from
|
74 |
*
|
74 |
*
|
75 |
* @var Object
|
75 |
* @var Object
|
76 |
*/
|
76 |
*/
|
77 |
private $_reg = null;
|
77 |
private $_reg = null;
|
78 |
|
78 |
|
79 |
/**
|
79 |
/**
|
80 |
* holds the COM object that we pull all the EnumKey data from
|
80 |
* holds result of 'cmd /c ver'
|
81 |
*
|
81 |
*
|
82 |
* @var Object
|
82 |
* @var string
|
83 |
*/
|
83 |
*/
|
84 |
private $_key = null;
|
84 |
private $_ver = "";
|
85 |
|
85 |
|
86 |
/**
|
86 |
/**
|
87 |
* holds all devices, which are in the system
|
87 |
* holds all devices, which are in the system
|
88 |
*
|
88 |
*
|
89 |
* @var array
|
89 |
* @var array
|
90 |
*/
|
90 |
*/
|
91 |
private $_wmidevices;
|
91 |
private $_wmidevices = array();
|
92 |
|
92 |
|
93 |
/**
|
93 |
/**
|
94 |
* holds all disks, which are in the system
|
94 |
* holds all disks, which are in the system
|
95 |
*
|
95 |
*
|
96 |
* @var array
|
96 |
* @var array
|
97 |
*/
|
97 |
*/
|
98 |
private $_wmidisks;
|
98 |
private $_wmidisks = array();
|
99 |
|
99 |
|
100 |
/**
|
100 |
/**
|
101 |
* store language encoding of the system to convert some output to utf-8
|
101 |
* store language encoding of the system to convert some output to utf-8
|
102 |
*
|
102 |
*
|
103 |
* @var string
|
103 |
* @var string
|
Line 127... |
Line 127... |
127 |
*
|
127 |
*
|
128 |
* @return array
|
128 |
* @return array
|
129 |
*/
|
129 |
*/
|
130 |
private function _get_Win32_ComputerSystem()
|
130 |
private function _get_Win32_ComputerSystem()
|
131 |
{
|
131 |
{
|
132 |
if ($this->_Win32_ComputerSystem === null) $this->_Win32_ComputerSystem = CommonFunctions::getWMI($this->_wmi, 'Win32_ComputerSystem', array('Name', 'Manufacturer', 'Model'));
|
132 |
if ($this->_Win32_ComputerSystem === null) $this->_Win32_ComputerSystem = CommonFunctions::getWMI($this->_wmi, 'Win32_ComputerSystem', array('Name', 'Manufacturer', 'Model', 'SystemFamily'));
|
133 |
return $this->_Win32_ComputerSystem;
|
133 |
return $this->_Win32_ComputerSystem;
|
134 |
}
|
134 |
}
|
135 |
|
135 |
|
136 |
/**
|
136 |
/**
|
137 |
* reads the data from WMI Win32_Processor
|
137 |
* reads the data from WMI Win32_Processor
|
Line 172... |
Line 172... |
172 |
*
|
172 |
*
|
173 |
* @return string
|
173 |
* @return string
|
174 |
*/
|
174 |
*/
|
175 |
private function _get_systeminfo()
|
175 |
private function _get_systeminfo()
|
176 |
{
|
176 |
{
|
- |
|
177 |
if (!defined('PSI_EMU_HOSTNAME')) {
|
177 |
if ($this->_systeminfo === null) CommonFunctions::executeProgram('systeminfo', '', $this->_systeminfo, false);
|
178 |
if ($this->_systeminfo === null) CommonFunctions::executeProgram('systeminfo', '', $this->_systeminfo, false);
|
178 |
return $this->_systeminfo;
|
179 |
return $this->_systeminfo;
|
- |
|
180 |
} else {
|
- |
|
181 |
return '';
|
- |
|
182 |
}
|
179 |
}
|
183 |
}
|
180 |
|
184 |
|
181 |
/**
|
185 |
/**
|
182 |
* build the global Error object and create the WMI connection
|
186 |
* build the global Error object and create the WMI connection
|
183 |
*/
|
187 |
*/
|
184 |
public function __construct($blockname = false)
|
188 |
public function __construct($blockname = false)
|
185 |
{
|
189 |
{
|
186 |
parent::__construct($blockname);
|
190 |
parent::__construct($blockname);
|
- |
|
191 |
if (!defined('PSI_EMU_HOSTNAME') && CommonFunctions::executeProgram('cmd', '/c ver 2>nul', $ver_value, false) && (($ver_value = trim($ver_value)) !== "")) {
|
- |
|
192 |
$this->_ver = $ver_value;
|
- |
|
193 |
}
|
- |
|
194 |
if (($this->_ver !== "") && preg_match("/ReactOS\r?\n\S+\s+.+/", $this->_ver)) {
|
- |
|
195 |
$this->_wmi = false; // No WMI info on ReactOS yet
|
- |
|
196 |
$this->_reg = false; // No EnumKey and ReadReg on ReactOS yet
|
187 |
try {
|
197 |
} else {
|
188 |
// initialize the wmi object
|
198 |
if (PSI_OS == 'WINNT') {
|
- |
|
199 |
if (defined('PSI_EMU_HOSTNAME')) {
|
- |
|
200 |
try {
|
189 |
$objLocator = new COM('WbemScripting.SWbemLocator');
|
201 |
$objLocator = new COM('WbemScripting.SWbemLocator');
|
190 |
$this->_wmi = $objLocator->ConnectServer('', 'root\CIMv2');
|
202 |
$wmi = $objLocator->ConnectServer('', 'root\CIMv2');
|
- |
|
203 |
$buffer = CommonFunctions::getWMI($wmi, 'Win32_OperatingSystem', array('CodeSet'));
|
191 |
} catch (Exception $e) {
|
204 |
if (!$buffer) {
|
- |
|
205 |
$reg = $objLocator->ConnectServer('', 'root\default');
|
192 |
$this->error->addError("WMI connect error", "PhpSysInfo can not connect to the WMI interface for security reasons.\nCheck an authentication mechanism for the directory where phpSysInfo is installed.");
|
206 |
if (CommonFunctions::readReg($reg, "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Nls\\CodePage\\ACP", $strBuf, false)) {
|
- |
|
207 |
$buffer[0]['CodeSet'] = $strBuf;
|
193 |
}
|
208 |
}
|
194 |
try {
|
209 |
}
|
- |
|
210 |
if ($buffer && isset($buffer[0])) {
|
- |
|
211 |
if (isset($buffer[0]['CodeSet'])) {
|
- |
|
212 |
$codeset = $buffer[0]['CodeSet'];
|
- |
|
213 |
if ($codeset == 932) {
|
- |
|
214 |
$codename = ' (SJIS)';
|
- |
|
215 |
} elseif ($codeset == 949) {
|
- |
|
216 |
$codename = ' (EUC-KR)';
|
- |
|
217 |
} elseif ($codeset == 950) {
|
- |
|
218 |
$codename = ' (BIG-5)';
|
195 |
// initialize the RegRead object
|
219 |
} else {
|
196 |
$this->_reg = new COM("WScript.Shell");
|
220 |
$codename = '';
|
- |
|
221 |
}
|
- |
|
222 |
define('PSI_SYSTEM_CODEPAGE', 'windows-'.$codeset.$codename);
|
- |
|
223 |
}
|
- |
|
224 |
}
|
197 |
} catch (Exception $e) {
|
225 |
} catch (Exception $e) {
|
- |
|
226 |
define('PSI_SYSTEM_CODEPAGE', null);
|
- |
|
227 |
if (PSI_DEBUG) {
|
198 |
//$this->error->addError("Windows Scripting Host error", "PhpSysInfo can not initialize Windows Scripting Host for security reasons.\nCheck an authentication mechanism for the directory where phpSysInfo is installed.");
|
228 |
$this->error->addError("WMI connect error", "PhpSysInfo can not connect to the WMI interface for security reasons.\nCheck an authentication mechanism for the directory where phpSysInfo is installed");
|
- |
|
229 |
}
|
- |
|
230 |
}
|
199 |
$this->_reg = false;
|
231 |
} else {
|
- |
|
232 |
define('PSI_SYSTEM_CODEPAGE', null);
|
200 |
}
|
233 |
}
|
201 |
try {
|
234 |
}
|
- |
|
235 |
$this->_wmi = CommonFunctions::initWMI('root\CIMv2', true);
|
202 |
// initialize the EnumKey object
|
236 |
if (PSI_OS == 'WINNT') {
|
203 |
$this->_key = new COM("winmgmts:{impersonationLevel=impersonate}!\\\\.\\root\\default:StdRegProv");
|
237 |
$this->_reg = CommonFunctions::initWMI('root\default', PSI_DEBUG);
|
204 |
} catch (Exception $e) {
|
238 |
if (gettype($this->_reg) === "object") {
|
- |
|
239 |
$this->_reg->Security_->ImpersonationLevel = 3;
|
205 |
//$this->error->addError("WWinmgmts Impersonationlevel Script Error", "PhpSysInfo can not initialize Winmgmts Impersonationlevel Script for security reasons.\nCheck an authentication mechanism for the directory where phpSysInfo is installed.");
|
240 |
}
|
206 |
$this->_key = false;
|
241 |
} else {
|
- |
|
242 |
$this->_reg = false; // No EnumKey and ReadReg on Linux
|
- |
|
243 |
}
|
207 |
}
|
244 |
}
|
208 |
|
245 |
|
209 |
$this->_getCodeSet();
|
246 |
$this->_getCodeSet();
|
210 |
}
|
247 |
}
|
211 |
|
248 |
|
Line 272... |
Line 309... |
272 |
} else {
|
309 |
} else {
|
273 |
$this->_wmidisks = CommonFunctions::getWMI($this->_wmi, 'Win32_DiskDrive', array('PNPDeviceID', 'Size'));
|
310 |
$this->_wmidisks = CommonFunctions::getWMI($this->_wmi, 'Win32_DiskDrive', array('PNPDeviceID', 'Size'));
|
274 |
}
|
311 |
}
|
275 |
} else {
|
312 |
} else {
|
276 |
$this->_wmidevices = CommonFunctions::getWMI($this->_wmi, 'Win32_PnPEntity', array('Name', 'PNPDeviceID'));
|
313 |
$this->_wmidevices = CommonFunctions::getWMI($this->_wmi, 'Win32_PnPEntity', array('Name', 'PNPDeviceID'));
|
- |
|
314 |
}
|
- |
|
315 |
|
277 |
$this->_wmidisks = array();
|
316 |
if (empty($this->_wmidevices)) {
|
- |
|
317 |
$hkey = "HKEY_LOCAL_MACHINE\\HARDWARE\\DEVICEMAP\\Scsi";
|
- |
|
318 |
$id = 0;
|
- |
|
319 |
if (CommonFunctions::enumKey($this->_reg, $hkey, $portBuf, false)) {
|
- |
|
320 |
foreach ($portBuf as $scsiport) {
|
- |
|
321 |
if (CommonFunctions::enumKey($this->_reg, $hkey."\\".$scsiport, $busBuf, false)) {
|
- |
|
322 |
foreach ($busBuf as $scsibus) {
|
- |
|
323 |
if (CommonFunctions::enumKey($this->_reg, $hkey."\\".$scsiport."\\".$scsibus, $tarBuf, false)) {
|
- |
|
324 |
foreach ($tarBuf as $scsitar) if (!strncasecmp($scsitar, "Target Id ", strlen("Target Id "))) {
|
- |
|
325 |
if (CommonFunctions::enumKey($this->_reg, $hkey."\\".$scsiport."\\".$scsibus."\\".$scsitar, $logBuf, false)) {
|
- |
|
326 |
foreach ($logBuf as $scsilog) if (!strncasecmp($scsilog, "Logical Unit Id ", strlen("Logical Unit Id "))) {
|
- |
|
327 |
$hkey2 = $hkey."\\".$scsiport."\\".$scsibus."\\".$scsitar."\\".$scsilog."\\";
|
- |
|
328 |
if ((CommonFunctions::readReg($this->_reg, $hkey2."DeviceType", $typeBuf, false) || CommonFunctions::readReg($this->_reg, $hkey2."Type", $typeBuf, false))
|
- |
|
329 |
&& (($typeBuf=strtolower(trim($typeBuf))) !== "")) {
|
- |
|
330 |
if ((($typeBuf == 'diskperipheral') || ($typeBuf == 'cdromperipheral'))
|
- |
|
331 |
&& CommonFunctions::readReg($this->_reg, $hkey2."Identifier", $ideBuf, false)) {
|
- |
|
332 |
$this->_wmidevices[] = array('Name'=>$ideBuf, 'PNPDeviceID'=>'SCSI\\'.$id);
|
- |
|
333 |
if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS && defined('PSI_SHOW_DEVICES_SERIAL') && PSI_SHOW_DEVICES_SERIAL
|
- |
|
334 |
&& (CommonFunctions::readReg($this->_reg, $hkey2."SerialNumber", $serBuf, false))
|
- |
|
335 |
&& (($serBuf=trim($serBuf)) !== "")) {
|
- |
|
336 |
$this->_wmidisks[] = array('PNPDeviceID'=>'SCSI\\'.$id, 'SerialNumber'=>$serBuf);
|
- |
|
337 |
}
|
- |
|
338 |
$id++;
|
- |
|
339 |
}
|
- |
|
340 |
}
|
- |
|
341 |
}
|
- |
|
342 |
}
|
- |
|
343 |
}
|
- |
|
344 |
}
|
- |
|
345 |
}
|
- |
|
346 |
}
|
- |
|
347 |
}
|
- |
|
348 |
}
|
278 |
}
|
349 |
}
|
279 |
}
|
350 |
}
|
- |
|
351 |
|
280 |
$list = array();
|
352 |
$list = array();
|
281 |
foreach ($this->_wmidevices as $device) {
|
353 |
foreach ($this->_wmidevices as $device) {
|
282 |
if (substr($device['PNPDeviceID'], 0, strpos($device['PNPDeviceID'], "\\") + 1) == ($strType."\\")) {
|
354 |
if (substr($device['PNPDeviceID'], 0, strpos($device['PNPDeviceID'], "\\") + 1) == ($strType."\\")) {
|
283 |
if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS) {
|
355 |
if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS) {
|
284 |
if (!isset($device['PNPClass']) || ($device['PNPClass']===$strType) || ($device['PNPClass']==='System')) {
|
356 |
if (!isset($device['PNPClass']) || ($device['PNPClass']===$strType) || ($device['PNPClass']==='System')) {
|
285 |
$device['PNPClass'] = null;
|
357 |
$device['PNPClass'] = null;
|
286 |
}
|
358 |
}
|
287 |
if (preg_match('/^\(.*\)$/', $device['Manufacturer'])) {
|
359 |
if (!isset($device['Manufacturer']) || preg_match('/^\(.*\)$/', $device['Manufacturer']) || (($device['PNPClass']==='USB') && preg_match('/\sUSB\s/', $device['Manufacturer']))) {
|
288 |
$device['Manufacturer'] = null;
|
360 |
$device['Manufacturer'] = null;
|
289 |
}
|
361 |
}
|
290 |
$device['Capacity'] = null;
|
362 |
$device['Capacity'] = null;
|
291 |
if (($strType==='IDE')||($strType==='SCSI')) {
|
363 |
if (($strType==='IDE')||($strType==='SCSI')) {
|
292 |
foreach ($this->_wmidisks as $disk) {
|
364 |
foreach ($this->_wmidisks as $disk) {
|
Line 326... |
Line 398... |
326 |
*
|
398 |
*
|
327 |
* @return void
|
399 |
* @return void
|
328 |
*/
|
400 |
*/
|
329 |
private function _hostname()
|
401 |
private function _hostname()
|
330 |
{
|
402 |
{
|
331 |
if (PSI_USE_VHOST === true) {
|
403 |
if ((PSI_USE_VHOST === true) && !defined('PSI_EMU_HOSTNAME')) {
|
332 |
if (CommonFunctions::readenv('SERVER_NAME', $hnm)) $this->sys->setHostname($hnm);
|
404 |
if (CommonFunctions::readenv('SERVER_NAME', $hnm)) $this->sys->setHostname($hnm);
|
333 |
} else {
|
405 |
} else {
|
334 |
$buffer = $this->_get_Win32_ComputerSystem();
|
406 |
$buffer = $this->_get_Win32_ComputerSystem();
|
335 |
if (!$buffer && CommonFunctions::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\ComputerName\\ActiveComputerName\\ComputerName", $strBuf, false) && (strlen($strBuf) > 0)) {
|
407 |
if (!$buffer && CommonFunctions::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\ComputerName\\ActiveComputerName\\ComputerName", $strBuf, false) && (strlen($strBuf) > 0)) {
|
336 |
$buffer[0]['Name'] = $strBuf;
|
408 |
$buffer[0]['Name'] = $strBuf;
|
Line 345... |
Line 417... |
345 |
(version_compare("127.0.0.0", $ip, "<=") && version_compare($ip, "127.255.255.255", "<=")) ||
|
417 |
(version_compare("127.0.0.0", $ip, "<=") && version_compare($ip, "127.255.255.255", "<=")) ||
|
346 |
(version_compare("169.254.1.0", $ip, "<=") && version_compare($ip, "169.254.254.255", "<=")) ||
|
418 |
(version_compare("169.254.1.0", $ip, "<=") && version_compare($ip, "169.254.254.255", "<=")) ||
|
347 |
(version_compare("255.255.255.255", $ip, "=="))) {
|
419 |
(version_compare("255.255.255.255", $ip, "=="))) {
|
348 |
$this->sys->setHostname($result); // internal ip
|
420 |
$this->sys->setHostname($result); // internal ip
|
349 |
} else {
|
421 |
} else {
|
- |
|
422 |
$hostname = gethostbyaddr($ip);
|
- |
|
423 |
if ($hostname !== false)
|
350 |
$this->sys->setHostname(gethostbyaddr($ip));
|
424 |
$this->sys->setHostname($hostname);
|
- |
|
425 |
else
|
- |
|
426 |
$this->sys->setHostname($result);
|
351 |
}
|
427 |
}
|
- |
|
428 |
} else {
|
- |
|
429 |
$this->sys->setHostname($result);
|
352 |
}
|
430 |
}
|
353 |
} else {
|
431 |
} elseif (defined('PSI_EMU_HOSTNAME')) {
|
- |
|
432 |
$this->sys->setHostname(PSI_EMU_HOSTNAME);
|
354 |
if (CommonFunctions::readenv('COMPUTERNAME', $hnm)) $this->sys->setHostname($hnm);
|
433 |
} elseif (CommonFunctions::readenv('COMPUTERNAME', $hnm)) {
|
- |
|
434 |
$this->sys->setHostname($hnm);
|
355 |
}
|
435 |
}
|
356 |
}
|
436 |
}
|
357 |
}
|
437 |
}
|
358 |
|
438 |
|
359 |
/**
|
439 |
/**
|
Line 411... |
Line 491... |
411 |
*
|
491 |
*
|
412 |
* @return void
|
492 |
* @return void
|
413 |
*/
|
493 |
*/
|
414 |
protected function _users()
|
494 |
protected function _users()
|
415 |
{
|
495 |
{
|
416 |
if (CommonFunctions::executeProgram('quser', '', $strBuf, false) && (strlen($strBuf) > 0)) {
|
496 |
if (!defined('PSI_EMU_HOSTNAME') && CommonFunctions::executeProgram('quser', '', $strBuf, false) && (strlen($strBuf) > 0)) {
|
417 |
$lines = preg_split('/\n/', $strBuf);
|
497 |
$lines = preg_split('/\n/', $strBuf);
|
418 |
$users = count($lines)-1;
|
498 |
$users = count($lines)-1;
|
419 |
} else {
|
499 |
} else {
|
420 |
$users = 0;
|
500 |
$users = 0;
|
421 |
$buffer = CommonFunctions::getWMI($this->_wmi, 'Win32_Process', array('Caption'));
|
501 |
$buffer = CommonFunctions::getWMI($this->_wmi, 'Win32_Process', array('Caption'));
|
Line 458... |
Line 538... |
458 |
elseif (version_compare($ver, "6.0", ">=") && version_compare($ver, "6.2", "<"))
|
538 |
elseif (version_compare($ver, "6.0", ">=") && version_compare($ver, "6.2", "<"))
|
459 |
$icon = 'WinVista.png';
|
539 |
$icon = 'WinVista.png';
|
460 |
else
|
540 |
else
|
461 |
$icon = 'Win8.png';
|
541 |
$icon = 'Win8.png';
|
462 |
$this->sys->setDistributionIcon($icon);
|
542 |
$this->sys->setDistributionIcon($icon);
|
463 |
} elseif (CommonFunctions::executeProgram('cmd', '/c ver 2>nul', $ver_value, false)) {
|
543 |
} elseif ($this->_ver !== "") {
|
464 |
if (preg_match("/ReactOS\r?\nVersion\s+(.+)/", $ver_value, $ar_temp)) {
|
544 |
if (preg_match("/ReactOS\r?\n\S+\s+(.+)/", $this->_ver, $ar_temp)) {
|
- |
|
545 |
if (preg_match("/^(\d+\.\d+\.\d+[\S]*)(.+)$/", trim($ar_temp[1]), $ver_temp)) {
|
- |
|
546 |
$this->sys->setDistribution("ReactOS ".trim($ver_temp[1]));
|
- |
|
547 |
$this->sys->setKernel(trim($ver_temp[2]));
|
- |
|
548 |
} else {
|
465 |
$this->sys->setDistribution("ReactOS");
|
549 |
$this->sys->setDistribution("ReactOS");
|
466 |
$this->sys->setKernel($ar_temp[1]);
|
550 |
$this->sys->setKernel($ar_temp[1]);
|
- |
|
551 |
}
|
467 |
$this->sys->setDistributionIcon('ReactOS.png');
|
552 |
$this->sys->setDistributionIcon('ReactOS.png');
|
468 |
$this->_wmi = false; // No WMI info on ReactOS yet
|
- |
|
469 |
} elseif (preg_match("/^(Microsoft [^\[]*)\s*\[\D*\s*(.+)\]/", $ver_value, $ar_temp)) {
|
553 |
} elseif (preg_match("/^(Microsoft [^\[]*)\s*\[\D*\s*(.+)\]/", $this->_ver, $ar_temp)) {
|
470 |
if (CommonFunctions::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProductName", $strBuf, false) && (strlen($strBuf) > 0)) {
|
554 |
if (CommonFunctions::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProductName", $strBuf, false) && (strlen($strBuf) > 0)) {
|
471 |
if (preg_match("/^Microsoft /", $strBuf)) {
|
555 |
if (preg_match("/^Microsoft /", $strBuf)) {
|
472 |
$this->sys->setDistribution($strBuf);
|
556 |
$this->sys->setDistribution($strBuf);
|
473 |
} else {
|
557 |
} else {
|
474 |
$this->sys->setDistribution("Microsoft ".$strBuf);
|
558 |
$this->sys->setDistribution("Microsoft ".$strBuf);
|
Line 486... |
Line 570... |
486 |
$icon = 'Win8.png';
|
570 |
$icon = 'Win8.png';
|
487 |
else
|
571 |
else
|
488 |
$icon = 'WinXP.png';
|
572 |
$icon = 'WinXP.png';
|
489 |
$this->sys->setDistributionIcon($icon);
|
573 |
$this->sys->setDistributionIcon($icon);
|
490 |
} else {
|
574 |
} else {
|
491 |
$this->sys->setDistribution("WinNT");
|
575 |
$this->sys->setDistribution("WINNT");
|
492 |
$this->sys->setDistributionIcon('Win2000.png');
|
576 |
$this->sys->setDistributionIcon('WINNT.png');
|
493 |
}
|
577 |
}
|
494 |
} else {
|
578 |
} else {
|
495 |
$this->sys->setDistribution("WinNT");
|
579 |
$this->sys->setDistribution("WINNT");
|
496 |
$this->sys->setDistributionIcon('Win2000.png');
|
580 |
$this->sys->setDistributionIcon('WINNT.png');
|
497 |
}
|
581 |
}
|
498 |
}
|
582 |
}
|
499 |
|
583 |
|
500 |
/**
|
584 |
/**
|
501 |
* Processor Load
|
585 |
* Processor Load
|
Line 540... |
Line 624... |
540 |
private function _cpuinfo()
|
624 |
private function _cpuinfo()
|
541 |
{
|
625 |
{
|
542 |
$allCpus = $this->_get_Win32_Processor();
|
626 |
$allCpus = $this->_get_Win32_Processor();
|
543 |
if (!$allCpus) {
|
627 |
if (!$allCpus) {
|
544 |
$hkey = "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\CentralProcessor";
|
628 |
$hkey = "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\CentralProcessor";
|
545 |
if (CommonFunctions::enumKey($this->_key, $hkey, $arrBuf, false)) {
|
629 |
if (CommonFunctions::enumKey($this->_reg, $hkey, $arrBuf, false)) {
|
546 |
foreach ($arrBuf as $coreCount) {
|
630 |
foreach ($arrBuf as $coreCount) {
|
547 |
if (CommonFunctions::readReg($this->_reg, $hkey."\\".$coreCount."\\ProcessorNameString", $strBuf, false)) {
|
631 |
if (CommonFunctions::readReg($this->_reg, $hkey."\\".$coreCount."\\ProcessorNameString", $strBuf, false)) {
|
548 |
$allCpus[$coreCount]['Name'] = $strBuf;
|
632 |
$allCpus[$coreCount]['Name'] = $strBuf;
|
549 |
}
|
633 |
}
|
550 |
if (CommonFunctions::readReg($this->_reg, $hkey."\\".$coreCount."\\~MHz", $strBuf, false)) {
|
634 |
if (CommonFunctions::readReg($this->_reg, $hkey."\\".$coreCount."\\~MHz", $strBuf, false)) {
|
Line 609... |
Line 693... |
609 |
* @return void
|
693 |
* @return void
|
610 |
*/
|
694 |
*/
|
611 |
private function _machine()
|
695 |
private function _machine()
|
612 |
{
|
696 |
{
|
613 |
$buffer = $this->_get_Win32_ComputerSystem();
|
697 |
$buffer = $this->_get_Win32_ComputerSystem();
|
- |
|
698 |
$bufferp = CommonFunctions::getWMI($this->_wmi, 'Win32_BaseBoard', array('Product'));
|
- |
|
699 |
$bufferb = CommonFunctions::getWMI($this->_wmi, 'Win32_BIOS', array('SMBIOSBIOSVersion', 'ReleaseDate'));
|
- |
|
700 |
|
614 |
if ($buffer) {
|
701 |
if (!$buffer) {
|
- |
|
702 |
if (CommonFunctions::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\BIOS\\systemManufacturer", $strBuf, false)) {
|
- |
|
703 |
$buffer[0]['Manufacturer'] = $strBuf;
|
- |
|
704 |
}
|
- |
|
705 |
if (CommonFunctions::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\BIOS\\SystemProductName", $strBuf, false)) {
|
- |
|
706 |
$buffer[0]['Model'] = $strBuf;
|
- |
|
707 |
}
|
- |
|
708 |
if (CommonFunctions::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\BIOS\\SystemFamily", $strBuf, false)) {
|
- |
|
709 |
$buffer[0]['SystemFamily'] = $strBuf;
|
- |
|
710 |
}
|
- |
|
711 |
}
|
- |
|
712 |
if (!$bufferp) {
|
- |
|
713 |
if (CommonFunctions::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\BIOS\\BaseBoardProduct", $strBuf, false)) {
|
- |
|
714 |
$bufferp[0]['Product'] = $strBuf;
|
- |
|
715 |
}
|
- |
|
716 |
}
|
- |
|
717 |
if (!$bufferb) {
|
- |
|
718 |
if (CommonFunctions::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\BIOS\\BIOSVersion", $strBuf, false)) {
|
- |
|
719 |
$bufferb[0]['SMBIOSBIOSVersion'] = $strBuf;
|
- |
|
720 |
}
|
- |
|
721 |
if (CommonFunctions::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\BIOS\\BIOSReleaseDate", $strBuf, false)) {
|
- |
|
722 |
$bufferb[0]['ReleaseDate'] = $strBuf;
|
- |
|
723 |
}
|
- |
|
724 |
}
|
615 |
$buf = "";
|
725 |
$buf = "";
|
- |
|
726 |
$model = "";
|
- |
|
727 |
if ($buffer && isset($buffer[0])) {
|
616 |
if (isset($buffer[0]['Manufacturer']) && !preg_match("/^To be filled by O\.E\.M\.$|^System manufacturer$|^Not Specified$/i", $buf2=$buffer[0]['Manufacturer'])) {
|
728 |
if (isset($buffer[0]['Manufacturer']) && !preg_match("/^To be filled by O\.E\.M\.$|^System manufacturer$|^Not Specified$/i", $buf2=trim($buffer[0]['Manufacturer'])) && ($buf2 !== "")) {
|
617 |
$buf .= ' '.$buf2;
|
729 |
$buf .= ' '.$buf2;
|
618 |
}
|
730 |
}
|
619 |
|
731 |
|
620 |
if (isset($buffer[0]['Model']) && !preg_match("/^To be filled by O\.E\.M\.$|^System Product Name$|^Not Specified$/i", $buf2=$buffer[0]['Model'])) {
|
732 |
if (isset($buffer[0]['Model']) && !preg_match("/^To be filled by O\.E\.M\.$|^System Product Name$|^Not Specified$/i", $buf2=trim($buffer[0]['Model'])) && ($buf2 !== "")) {
|
- |
|
733 |
$model = $buf2;
|
621 |
$buf .= ' '.$buf2;
|
734 |
$buf .= ' '.$buf2;
|
622 |
}
|
735 |
}
|
- |
|
736 |
}
|
- |
|
737 |
if ($bufferp && isset($bufferp[0])) {
|
- |
|
738 |
if (isset($bufferp[0]['Product']) && !preg_match("/^To be filled by O\.E\.M\.$|^BaseBoard Product Name$|^Not Specified$|^Default string$/i", $buf2=trim($bufferp[0]['Product'])) && ($buf2 !== "")) {
|
623 |
if (trim($buf) != "") {
|
739 |
if ($buf2 !== $model) {
|
- |
|
740 |
$buf .= '/'.$buf2;
|
- |
|
741 |
} elseif (isset($buffer[0]['SystemFamily']) && !preg_match("/^To be filled by O\.E\.M\.$|^System Family$|^Not Specified$/i", $buf2=trim($buffer[0]['SystemFamily'])) && ($buf2 !== "")) {
|
- |
|
742 |
$buf .= '/'.$buf2;
|
- |
|
743 |
}
|
- |
|
744 |
}
|
- |
|
745 |
}
|
- |
|
746 |
if ($bufferb && isset($bufferb[0])) {
|
- |
|
747 |
$bver = "";
|
- |
|
748 |
$brel = "";
|
- |
|
749 |
if (isset($bufferb[0]['SMBIOSBIOSVersion']) && (($buf2=trim($bufferb[0]['SMBIOSBIOSVersion'])) !== "")) {
|
- |
|
750 |
$bver .= ' '.$buf2;
|
- |
|
751 |
}
|
- |
|
752 |
if (isset($bufferb[0]['ReleaseDate'])) {
|
- |
|
753 |
if (preg_match("/^(\d{4})(\d{2})(\d{2})\d{6}\.\d{6}\+\d{3}$/", $bufferb[0]['ReleaseDate'], $dateout)) {
|
- |
|
754 |
$brel .= ' '.$dateout[2].'/'.$dateout[3].'/'.$dateout[1];
|
- |
|
755 |
} elseif (preg_match("/^\d{2}\/\d{2}\/\d{4}$/", $bufferb[0]['ReleaseDate'])) {
|
- |
|
756 |
$brel .= ' '.$bufferb[0]['ReleaseDate'];
|
- |
|
757 |
}
|
- |
|
758 |
}
|
- |
|
759 |
if ((trim($bver) !== "") || (trim($brel) !== "")) {
|
624 |
$this->sys->setMachine(trim($buf));
|
760 |
$buf .= ', BIOS'.$bver.$brel;
|
625 |
}
|
761 |
}
|
626 |
}
|
762 |
}
|
- |
|
763 |
|
- |
|
764 |
if (trim($buf) != "") {
|
- |
|
765 |
$this->sys->setMachine(trim($buf));
|
- |
|
766 |
}
|
627 |
}
|
767 |
}
|
628 |
|
768 |
|
629 |
/**
|
769 |
/**
|
630 |
* Hardwaredevices
|
770 |
* Hardwaredevices
|
631 |
*
|
771 |
*
|
Line 635... |
Line 775... |
635 |
{
|
775 |
{
|
636 |
foreach ($this->_devicelist('PCI') as $pciDev) {
|
776 |
foreach ($this->_devicelist('PCI') as $pciDev) {
|
637 |
$dev = new HWDevice();
|
777 |
$dev = new HWDevice();
|
638 |
$dev->setName($pciDev['Name']);
|
778 |
$dev->setName($pciDev['Name']);
|
639 |
if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS) {
|
779 |
if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS) {
|
- |
|
780 |
if (($pciDev['Manufacturer'] !== null) && preg_match("/^@[^\.]+\.inf,%([^%]+)%$/i", trim($pciDev['Manufacturer']), $mbuff)) {
|
- |
|
781 |
$dev->setManufacturer($mbuff[1]);
|
- |
|
782 |
} else {
|
640 |
$dev->setManufacturer($pciDev['Manufacturer']);
|
783 |
$dev->setManufacturer($pciDev['Manufacturer']);
|
- |
|
784 |
}
|
641 |
$dev->setProduct($pciDev['Product']);
|
785 |
$dev->setProduct($pciDev['Product']);
|
642 |
}
|
786 |
}
|
643 |
$this->sys->setPciDevices($dev);
|
787 |
$this->sys->setPciDevices($dev);
|
644 |
}
|
788 |
}
|
645 |
|
789 |
|
Line 696... |
Line 840... |
696 |
$allDevices = CommonFunctions::getWMI($this->_wmi, 'Win32_PerfRawData_Tcpip_NetworkInterface', array('Name', 'BytesSentPersec', 'BytesTotalPersec', 'BytesReceivedPersec', 'PacketsReceivedErrors', 'PacketsReceivedDiscarded', 'CurrentBandwidth'));
|
840 |
$allDevices = CommonFunctions::getWMI($this->_wmi, 'Win32_PerfRawData_Tcpip_NetworkInterface', array('Name', 'BytesSentPersec', 'BytesTotalPersec', 'BytesReceivedPersec', 'PacketsReceivedErrors', 'PacketsReceivedDiscarded', 'CurrentBandwidth'));
|
697 |
}
|
841 |
}
|
698 |
if ($allDevices) {
|
842 |
if ($allDevices) {
|
699 |
$aliases = array();
|
843 |
$aliases = array();
|
700 |
$hkey = "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}";
|
844 |
$hkey = "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}";
|
701 |
if (CommonFunctions::enumKey($this->_key, $hkey, $arrBuf, false)) {
|
845 |
if (CommonFunctions::enumKey($this->_reg, $hkey, $arrBuf, false)) {
|
702 |
foreach ($arrBuf as $netID) {
|
846 |
foreach ($arrBuf as $netID) {
|
703 |
if (CommonFunctions::readReg($this->_reg, $hkey."\\".$netID."\\Connection\\PnPInstanceId", $strInstanceID, false)) { //a w Name jest net alias
|
847 |
if (CommonFunctions::readReg($this->_reg, $hkey."\\".$netID."\\Connection\\PnPInstanceId", $strInstanceID, false)) {
|
704 |
if (CommonFunctions::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Enum\\".$strInstanceID."\\FriendlyName", $strName, false)) {
|
848 |
if (CommonFunctions::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Enum\\".$strInstanceID."\\FriendlyName", $strName, false)) {
|
705 |
$cname = str_replace(array('(', ')', '#'), array('[', ']', '_'), $strName); //convert to canonical
|
849 |
$cname = str_replace(array('(', ')', '#', '/'), array('[', ']', '_', '_'), $strName); //convert to canonical
|
706 |
if (!isset($aliases[$cname])) { // duplicate checking
|
850 |
if (!isset($aliases[$cname])) { // duplicate checking
|
707 |
$aliases[$cname]['id'] = $netID;
|
851 |
$aliases[$cname]['id'] = $netID;
|
708 |
$aliases[$cname]['name'] = $strName;
|
852 |
$aliases[$cname]['name'] = $strName;
|
709 |
if (CommonFunctions::readReg($this->_reg, $hkey."\\".$netID."\\Connection\\Name", $strCName, false)
|
853 |
if (CommonFunctions::readReg($this->_reg, $hkey."\\".$netID."\\Connection\\Name", $strCName, false)
|
710 |
&& (str_replace(array('(', ')', '#'), array('[', ']', '_'), $strCName) !== $cname)) {
|
854 |
&& (str_replace(array('(', ')', '#', '/'), array('[', ']', '_', '_'), $strCName) !== $cname)) {
|
711 |
$aliases[$cname]['netname'] = $strCName;
|
855 |
$aliases[$cname]['netname'] = $strCName;
|
712 |
}
|
856 |
}
|
713 |
} else {
|
857 |
} else {
|
714 |
$aliases[$cname]['id'] = '';
|
858 |
$aliases[$cname]['id'] = '';
|
715 |
}
|
859 |
}
|
Line 718... |
Line 862... |
718 |
}
|
862 |
}
|
719 |
}
|
863 |
}
|
720 |
|
864 |
|
721 |
$aliases2 = array();
|
865 |
$aliases2 = array();
|
722 |
$hkey = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\NetworkCards";
|
866 |
$hkey = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\NetworkCards";
|
723 |
if (CommonFunctions::enumKey($this->_key, $hkey, $arrBuf, false)) {
|
867 |
if (CommonFunctions::enumKey($this->_reg, $hkey, $arrBuf, false)) {
|
724 |
foreach ($arrBuf as $netCount) {
|
868 |
foreach ($arrBuf as $netCount) {
|
725 |
if (CommonFunctions::readReg($this->_reg, $hkey."\\".$netCount."\\Description", $strName, false)
|
869 |
if (CommonFunctions::readReg($this->_reg, $hkey."\\".$netCount."\\Description", $strName, false)
|
726 |
&& CommonFunctions::readReg($this->_reg, $hkey."\\".$netCount."\\ServiceName", $strGUID, false)) {
|
870 |
&& CommonFunctions::readReg($this->_reg, $hkey."\\".$netCount."\\ServiceName", $strGUID, false)) {
|
727 |
$cname = str_replace(array('(', ')', '#'), array('[', ']', '_'), $strName); //convert to canonical
|
871 |
$cname = str_replace(array('(', ')', '#', '/'), array('[', ']', '_', '_'), $strName); //convert to canonical
|
728 |
if (!isset($aliases2[$cname])) { // duplicate checking
|
872 |
if (!isset($aliases2[$cname])) { // duplicate checking
|
729 |
$aliases2[$cname]['id'] = $strGUID;
|
873 |
$aliases2[$cname]['id'] = $strGUID;
|
730 |
$aliases2[$cname]['name'] = $strName;
|
874 |
$aliases2[$cname]['name'] = $strName;
|
731 |
} else {
|
875 |
} else {
|
732 |
$aliases2[$cname]['id'] = '';
|
876 |
$aliases2[$cname]['id'] = '';
|
Line 963... |
Line 1107... |
963 |
}
|
1107 |
}
|
964 |
|
1108 |
|
965 |
public function _processes()
|
1109 |
public function _processes()
|
966 |
{
|
1110 |
{
|
967 |
$processes['*'] = 0;
|
1111 |
$processes['*'] = 0;
|
968 |
if (CommonFunctions::executeProgram('qprocess', '*', $strBuf, false) && (strlen($strBuf) > 0)) {
|
1112 |
if (!defined('PSI_EMU_HOSTNAME') && CommonFunctions::executeProgram('qprocess', '*', $strBuf, false) && (strlen($strBuf) > 0)) {
|
969 |
$lines = preg_split('/\n/', $strBuf);
|
1113 |
$lines = preg_split('/\n/', $strBuf);
|
970 |
$processes['*'] = (count($lines)-1) - 3 ; //correction for process "qprocess *"
|
1114 |
$processes['*'] = (count($lines)-1) - 3 ; //correction for process "qprocess *"
|
971 |
}
|
1115 |
}
|
972 |
if ($processes['*'] <= 0) {
|
1116 |
if ($processes['*'] <= 0) {
|
973 |
$buffer = CommonFunctions::getWMI($this->_wmi, 'Win32_Process', array('Caption'));
|
1117 |
$buffer = CommonFunctions::getWMI($this->_wmi, 'Win32_Process', array('Caption'));
|
Line 976... |
Line 1120... |
976 |
$processes[' '] = $processes['*'];
|
1120 |
$processes[' '] = $processes['*'];
|
977 |
$this->sys->setProcesses($processes);
|
1121 |
$this->sys->setProcesses($processes);
|
978 |
}
|
1122 |
}
|
979 |
|
1123 |
|
980 |
/**
|
1124 |
/**
|
- |
|
1125 |
* MEM information
|
- |
|
1126 |
*
|
- |
|
1127 |
* @return void
|
- |
|
1128 |
*/
|
- |
|
1129 |
private function _meminfo()
|
- |
|
1130 |
{
|
- |
|
1131 |
$allMems = CommonFunctions::getWMI($this->_wmi, 'Win32_PhysicalMemory', array('PartNumber', 'DeviceLocator', 'Capacity', 'Manufacturer', 'SerialNumber', 'Speed', 'ConfiguredClockSpeed', 'ConfiguredVoltage', 'MemoryType', 'SMBIOSMemoryType', 'FormFactor', 'DataWidth', 'TotalWidth', 'BankLabel', 'MinVoltage', 'MaxVoltage'));
|
- |
|
1132 |
if ($allMems) {
|
- |
|
1133 |
$reg = false;
|
- |
|
1134 |
if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS) {
|
- |
|
1135 |
$arrMems = CommonFunctions::getWMI($this->_wmi, 'Win32_PhysicalMemoryArray', array('MemoryErrorCorrection'));
|
- |
|
1136 |
$reg = (count($arrMems) == 1) && isset($arrMems[0]['MemoryErrorCorrection']) && ($arrMems[0]['MemoryErrorCorrection'] == 6);
|
- |
|
1137 |
}
|
- |
|
1138 |
foreach ($allMems as $mem) {
|
- |
|
1139 |
$dev = new HWDevice();
|
- |
|
1140 |
$name = '';
|
- |
|
1141 |
if (isset($mem['PartNumber']) && !preg_match("/^PartNum\d+$/", $part = $mem['PartNumber']) && ($part != '') && ($part != 'None') && ($part != 'N/A') && ($part != 'NOT AVAILABLE')) {
|
- |
|
1142 |
$name = $part;
|
- |
|
1143 |
}
|
- |
|
1144 |
if (isset($mem['DeviceLocator']) && (($dloc = $mem['DeviceLocator']) != '') && ($dloc != 'None') && ($dloc != 'N/A')) {
|
- |
|
1145 |
if ($name != '') {
|
- |
|
1146 |
$name .= ' - '.$dloc;
|
- |
|
1147 |
} else {
|
- |
|
1148 |
$name = $dloc;
|
- |
|
1149 |
}
|
- |
|
1150 |
}
|
- |
|
1151 |
if (isset($mem['BankLabel']) && (($bank = $mem['BankLabel']) != '') && ($bank != 'None') && ($bank != 'N/A')) {
|
- |
|
1152 |
if ($name != '') {
|
- |
|
1153 |
$name .= ' in '.$bank;
|
- |
|
1154 |
} else {
|
- |
|
1155 |
$name = 'Physical Memory in '.$bank;
|
- |
|
1156 |
}
|
- |
|
1157 |
}
|
- |
|
1158 |
if ($name != '') {
|
- |
|
1159 |
$dev->setName(trim($name));
|
- |
|
1160 |
} else {
|
- |
|
1161 |
$dev->setName('Physical Memory');
|
- |
|
1162 |
}
|
- |
|
1163 |
if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS) {
|
- |
|
1164 |
if (isset($mem['Manufacturer']) && !preg_match("/^([A-F\d]{4}|[A-F\d]{12}|[A-F\d]{16})$/", $manufacturer = $mem['Manufacturer']) && !preg_match("/^Manufacturer\d+$/", $manufacturer) && !preg_match("/^Mfg \d+$/", $manufacturer) && ($manufacturer != '') && ($manufacturer != 'None') && ($manufacturer != 'N/A') && ($manufacturer != 'UNKNOWN')) {
|
- |
|
1165 |
$dev->setManufacturer($manufacturer);
|
- |
|
1166 |
}
|
- |
|
1167 |
if (isset($mem['Capacity'])) {
|
- |
|
1168 |
$dev->setCapacity($mem['Capacity']);
|
- |
|
1169 |
}
|
- |
|
1170 |
$memtype = '';
|
- |
|
1171 |
if (isset($mem['MemoryType']) && (($memval = $mem['MemoryType']) != 0)) {
|
- |
|
1172 |
switch ($memval) {
|
- |
|
1173 |
// case 0: $memtype = 'Unknown'; break;
|
- |
|
1174 |
// case 1: $memtype = 'Other'; break;
|
- |
|
1175 |
case 2: $memtype = 'DRAM'; break;
|
- |
|
1176 |
case 3: $memtype = 'Synchronous DRAM'; break;
|
- |
|
1177 |
case 4: $memtype = 'Cache DRAM'; break;
|
- |
|
1178 |
case 5: $memtype = 'EDO'; break;
|
- |
|
1179 |
case 6: $memtype = 'EDRAM'; break;
|
- |
|
1180 |
case 7: $memtype = 'VRAM'; break;
|
- |
|
1181 |
case 8: $memtype = 'SRAM'; break;
|
- |
|
1182 |
case 9: $memtype = 'RAM'; break;
|
- |
|
1183 |
case 10: $memtype = 'ROM'; break;
|
- |
|
1184 |
case 11: $memtype = 'Flash'; break;
|
- |
|
1185 |
case 12: $memtype = 'EEPROM'; break;
|
- |
|
1186 |
case 13: $memtype = 'FEPROM'; break;
|
- |
|
1187 |
case 14: $memtype = 'EPROM'; break;
|
- |
|
1188 |
case 15: $memtype = 'CDRAM'; break;
|
- |
|
1189 |
case 16: $memtype = '3DRAM'; break;
|
- |
|
1190 |
case 17: $memtype = 'SDRAM'; break;
|
- |
|
1191 |
case 18: $memtype = 'SGRAM'; break;
|
- |
|
1192 |
case 19: $memtype = 'RDRAM'; break;
|
- |
|
1193 |
case 20: $memtype = 'DDR'; break;
|
- |
|
1194 |
case 21: $memtype = 'DDR2'; break;
|
- |
|
1195 |
case 22: $memtype = 'DDR2 FB-DIMM'; break;
|
- |
|
1196 |
case 24: $memtype = 'DDR3'; break;
|
- |
|
1197 |
case 25: $memtype = 'FBD2'; break;
|
- |
|
1198 |
case 26: $memtype = 'DDR4'; break;
|
- |
|
1199 |
}
|
- |
|
1200 |
} elseif (isset($mem['SMBIOSMemoryType'])) {
|
- |
|
1201 |
switch ($mem['SMBIOSMemoryType']) {
|
- |
|
1202 |
// case 0: $memtype = 'Invalid'; break;
|
- |
|
1203 |
// case 1: $memtype = 'Other'; break;
|
- |
|
1204 |
// case 2: $memtype = 'Unknown'; break;
|
- |
|
1205 |
case 3: $memtype = 'DRAM'; break;
|
- |
|
1206 |
case 4: $memtype = 'EDRAM'; break;
|
- |
|
1207 |
case 5: $memtype = 'VRAM'; break;
|
- |
|
1208 |
case 6: $memtype = 'SRAM'; break;
|
- |
|
1209 |
case 7: $memtype = 'RAM'; break;
|
- |
|
1210 |
case 8: $memtype = 'ROM'; break;
|
- |
|
1211 |
case 9: $memtype = 'FLASH'; break;
|
- |
|
1212 |
case 10: $memtype = 'EEPROM'; break;
|
- |
|
1213 |
case 11: $memtype = 'FEPROM'; break;
|
- |
|
1214 |
case 12: $memtype = 'EPROM'; break;
|
- |
|
1215 |
case 13: $memtype = 'CDRAM'; break;
|
- |
|
1216 |
case 14: $memtype = '3DRAM'; break;
|
- |
|
1217 |
case 15: $memtype = 'SDRAM'; break;
|
- |
|
1218 |
case 16: $memtype = 'SGRAM'; break;
|
- |
|
1219 |
case 17: $memtype = 'RDRAM'; break;
|
- |
|
1220 |
case 18: $memtype = 'DDR'; break;
|
- |
|
1221 |
case 19: $memtype = 'DDR2'; break;
|
- |
|
1222 |
case 20: $memtype = 'DDR2 FB-DIMM'; break;
|
- |
|
1223 |
case 24: $memtype = 'DDR3'; break;
|
- |
|
1224 |
case 25: $memtype = 'FBD2'; break;
|
- |
|
1225 |
case 26: $memtype = 'DDR4'; break;
|
- |
|
1226 |
case 27: $memtype = 'LPDDR'; break;
|
- |
|
1227 |
case 28: $memtype = 'LPDDR2'; break;
|
- |
|
1228 |
case 29: $memtype = 'LPDDR3'; break;
|
- |
|
1229 |
case 30: $memtype = 'DDR3'; break;
|
- |
|
1230 |
case 31: $memtype = 'FBD2'; break;
|
- |
|
1231 |
case 32: $memtype = 'Logical non-volatile device'; break;
|
- |
|
1232 |
case 33: $memtype = 'HBM2'; break;
|
- |
|
1233 |
case 34: $memtype = 'DDR5'; break;
|
- |
|
1234 |
case 35: $memtype = 'LPDDR5'; break;
|
- |
|
1235 |
}
|
- |
|
1236 |
}
|
- |
|
1237 |
if (isset($mem['Speed']) && (($speed = $mem['Speed']) > 0) && (preg_match('/^(DDR\d*)(.*)/', $memtype, $dr) || preg_match('/^(SDR)AM(.*)/', $memtype, $dr))) {
|
- |
|
1238 |
if (isset($mem['MinVoltage']) && isset($mem['MaxVoltage']) && (($minv = $mem['MinVoltage']) > 0) && (($maxv = $mem['MaxVoltage']) > 0) && ($minv < $maxv)) {
|
- |
|
1239 |
$lv = 'L';
|
- |
|
1240 |
} else {
|
- |
|
1241 |
$lv = '';
|
- |
|
1242 |
}
|
- |
|
1243 |
if (isset($dr[2])) {
|
- |
|
1244 |
$memtype = $dr[1].$lv.'-'.$speed.' '.$dr[2];
|
- |
|
1245 |
} else {
|
- |
|
1246 |
$memtype = $dr[1].$lv.'-'.$speed;
|
- |
|
1247 |
}
|
- |
|
1248 |
}
|
- |
|
1249 |
if (isset($mem['FormFactor'])) {
|
- |
|
1250 |
switch ($mem['FormFactor']) {
|
- |
|
1251 |
// case 0: $memtype .= ' Unknown'; break;
|
- |
|
1252 |
// case 1: $memtype .= ' Other'; break;
|
- |
|
1253 |
case 2: $memtype .= ' SIP'; break;
|
- |
|
1254 |
case 3: $memtype .= ' DIP'; break;
|
- |
|
1255 |
case 4: $memtype .= ' ZIP'; break;
|
- |
|
1256 |
case 5: $memtype .= ' SOJ'; break;
|
- |
|
1257 |
case 6: $memtype .= ' Proprietary'; break;
|
- |
|
1258 |
case 7: $memtype .= ' SIMM'; break;
|
- |
|
1259 |
case 8: $memtype .= ' DIMM'; break;
|
- |
|
1260 |
case 9: $memtype .= ' TSOPO'; break;
|
- |
|
1261 |
case 10: $memtype .= ' PGA'; break;
|
- |
|
1262 |
case 11: $memtype .= ' RIM'; break;
|
- |
|
1263 |
case 12: $memtype .= ' SODIMM'; break;
|
- |
|
1264 |
case 13: $memtype .= ' SRIMM'; break;
|
- |
|
1265 |
case 14: $memtype .= ' SMD'; break;
|
- |
|
1266 |
case 15: $memtype .= ' SSMP'; break;
|
- |
|
1267 |
case 16: $memtype .= ' QFP'; break;
|
- |
|
1268 |
case 17: $memtype .= ' TQFP'; break;
|
- |
|
1269 |
case 18: $memtype .= ' SOIC'; break;
|
- |
|
1270 |
case 19: $memtype .= ' LCC'; break;
|
- |
|
1271 |
case 20: $memtype .= ' PLCC'; break;
|
- |
|
1272 |
case 21: $memtype .= ' BGA'; break;
|
- |
|
1273 |
case 22: $memtype .= ' FPBGA'; break;
|
- |
|
1274 |
case 23: $memtype .= ' LGA'; break;
|
- |
|
1275 |
}
|
- |
|
1276 |
}
|
- |
|
1277 |
if (isset($mem['DataWidth']) && isset($mem['TotalWidth']) && (($dataw = $mem['DataWidth']) > 0) && (($totalw = $mem['TotalWidth']) > 0) && ($dataw < $totalw)) {
|
- |
|
1278 |
$memtype .= ' ECC';
|
- |
|
1279 |
}
|
- |
|
1280 |
if ($reg) {
|
- |
|
1281 |
$memtype .= ' REG';
|
- |
|
1282 |
}
|
- |
|
1283 |
if (($memtype = trim($memtype)) != '') {
|
- |
|
1284 |
$dev->setProduct($memtype);
|
- |
|
1285 |
}
|
- |
|
1286 |
if (isset($mem['ConfiguredClockSpeed']) && (($clock = $mem['ConfiguredClockSpeed']) > 0)) {
|
- |
|
1287 |
$dev->setSpeed($clock);
|
- |
|
1288 |
}
|
- |
|
1289 |
if (isset($mem['ConfiguredVoltage']) && (($voltage = $mem['ConfiguredVoltage']) > 0)) {
|
- |
|
1290 |
$dev->setVoltage($voltage/1000);
|
- |
|
1291 |
}
|
- |
|
1292 |
if (defined('PSI_SHOW_DEVICES_SERIAL') && PSI_SHOW_DEVICES_SERIAL &&
|
- |
|
1293 |
isset($mem['SerialNumber']) && !preg_match("/^SerNum\d+$/", $serial = $mem['SerialNumber']) && ($serial != '') && ($serial != 'None')) {
|
- |
|
1294 |
$dev->setSerial($serial);
|
- |
|
1295 |
}
|
- |
|
1296 |
}
|
- |
|
1297 |
$this->sys->setMemDevices($dev);
|
- |
|
1298 |
}
|
- |
|
1299 |
}
|
- |
|
1300 |
}
|
- |
|
1301 |
|
- |
|
1302 |
/**
|
981 |
* get the information
|
1303 |
* get the information
|
982 |
*
|
1304 |
*
|
983 |
* @see PSI_Interface_OS::build()
|
1305 |
* @see PSI_Interface_OS::build()
|
984 |
*
|
1306 |
*
|
985 |
* @return Void
|
1307 |
* @return Void
|
Line 1001... |
Line 1323... |
1001 |
$this->_network();
|
1323 |
$this->_network();
|
1002 |
}
|
1324 |
}
|
1003 |
if (!$this->blockname || $this->blockname==='hardware') {
|
1325 |
if (!$this->blockname || $this->blockname==='hardware') {
|
1004 |
$this->_machine();
|
1326 |
$this->_machine();
|
1005 |
$this->_cpuinfo();
|
1327 |
$this->_cpuinfo();
|
- |
|
1328 |
$this->_meminfo();
|
1006 |
$this->_hardware();
|
1329 |
$this->_hardware();
|
1007 |
}
|
1330 |
}
|
1008 |
if (!$this->blockname || $this->blockname==='filesystem') {
|
1331 |
if (!$this->blockname || $this->blockname==='filesystem') {
|
1009 |
$this->_filesystems();
|
1332 |
$this->_filesystems();
|
1010 |
}
|
1333 |
}
|