How to use properties method of phodevi_system class

Best Phoronix-test-suite code snippet using phodevi_system.properties

phodevi_system.php

Source:phodevi_system.php Github

copy

Full Screen

...18*/19class phodevi_system extends phodevi_device_interface20{21 public static $report_wine_override = false;22 public static function properties()23 {24 return array(25 'username' => new phodevi_device_property('sw_username', phodevi::std_caching),26 'hostname' => new phodevi_device_property('sw_hostname', phodevi::smart_caching),27 'vendor-identifier' => new phodevi_device_property('sw_vendor_identifier', phodevi::smart_caching),28 'filesystem' => new phodevi_device_property('sw_filesystem', phodevi::no_caching),29 'virtualized-mode' => new phodevi_device_property('sw_virtualized_mode', phodevi::smart_caching),30 'java-version' => new phodevi_device_property('sw_java_version', phodevi::std_caching),31 'python-version' => new phodevi_device_property('sw_python_version', phodevi::std_caching),32 'wine-version' => new phodevi_device_property('sw_wine_version', phodevi::std_caching),33 'display-server' => new phodevi_device_property('sw_display_server', phodevi::smart_caching),34 'display-driver' => new phodevi_device_property(array('sw_display_driver', false), phodevi::smart_caching),35 'display-driver-string' => new phodevi_device_property(array('sw_display_driver', true), phodevi::smart_caching),36 'dri-display-driver' => new phodevi_device_property('sw_dri_display_driver', phodevi::smart_caching),37 'opengl-driver' => new phodevi_device_property('sw_opengl_driver', phodevi::std_caching),38 'vulkan-driver' => new phodevi_device_property('sw_vulkan_driver', phodevi::std_caching),39 'opencl-driver' => new phodevi_device_property('sw_opencl_driver', phodevi::std_caching),40 'opengl-vendor' => new phodevi_device_property('sw_opengl_vendor', phodevi::smart_caching),41 'desktop-environment' => new phodevi_device_property('sw_desktop_environment', phodevi::smart_caching),42 'operating-system' => new phodevi_device_property('sw_operating_system', phodevi::smart_caching),43 'os-version' => new phodevi_device_property('sw_os_version', phodevi::smart_caching),44 'kernel' => new phodevi_device_property('sw_kernel', phodevi::smart_caching),45 'kernel-architecture' => new phodevi_device_property('sw_kernel_architecture', phodevi::smart_caching),46 'kernel-date' => new phodevi_device_property('sw_kernel_date', phodevi::smart_caching),47 'kernel-string' => new phodevi_device_property('sw_kernel_string', phodevi::smart_caching),48 'kernel-parameters' => new phodevi_device_property('sw_kernel_parameters', phodevi::std_caching),49 'compiler' => new phodevi_device_property('sw_compiler', phodevi::no_caching),50 'system-layer' => new phodevi_device_property('sw_system_layer', phodevi::no_caching),51 'environment-variables' => new phodevi_device_property('sw_environment_variables', phodevi::std_caching),52 'security-features' => new phodevi_device_property('sw_security_features', phodevi::std_caching),53 'kernel-extra-details' => new phodevi_device_property('sw_kernel_extra_details', phodevi::std_caching),54 'battery' => new phodevi_device_property('battery', phodevi::smart_caching),55 'platform-profile' => new phodevi_device_property('sw_platform_profile', phodevi::std_caching),56 );57 }58 public static function sw_username()59 {60 // Gets the system user's name61 if(function_exists('posix_getpwuid') && function_exists('posix_getuid'))62 {63 $userinfo = posix_getpwuid(posix_getuid());64 $username = $userinfo['name'];65 }66 else67 {68 $username = trim(getenv('USERNAME'));69 }70 return $username;71 }72 public static function sw_platform_profile()73 {74 $platform_profile = '';75 if(phodevi::is_linux())76 {77 if(is_file('/sys/firmware/acpi/platform_profile'))78 {79 $platform_profile = pts_file_io::file_get_contents('/sys/firmware/acpi/platform_profile');80 }81 }82 return $platform_profile;83 }84 public static function sw_kernel_extra_details()85 {86 $extra = array();87 if(phodevi::is_linux())88 {89 if(is_file('/sys/kernel/mm/transparent_hugepage/enabled'))90 {91 $thp_enabled = file_get_contents('/sys/kernel/mm/transparent_hugepage/enabled');92 if(($x = strpos($thp_enabled, '[')) !== false)93 {94 $thp_enabled = substr($thp_enabled, $x + 1);95 if(($x = strpos($thp_enabled, ']')) !== false)96 {97 $thp_enabled = trim(substr($thp_enabled, 0, $x));98 if(!empty($thp_enabled))99 {100 $extra[] = 'Transparent Huge Pages: ' . $thp_enabled;101 }102 }103 }104 }105 }106 return implode(' - ', $extra);107 }108 public static function sw_system_layer()109 {110 $layer = null;111 if(phodevi::is_windows() && pts_client::executable_in_path('winecfg.exe') && ($wine = phodevi::read_property('system', 'wine-version')))112 {113 $layer = $wine;114 }115 else if((getenv('USE_WINE') || getenv('WINE_VERSION') || self::$report_wine_override) && ($wine = phodevi::read_property('system', 'wine-version')))116 {117 $layer = $wine;118 }119 else120 {121 // Report virtualization122 $layer = phodevi::read_property('system', 'virtualized-mode');123 }124 if(empty($layer) && is_file('/proc/version'))125 {126 if(stripos(file_get_contents('/proc/version'), 'Microsoft') !== false && stripos(file_get_contents('/proc/mounts'), 'lxfs') !== false)127 {128 // Microsoft Windows Subsystem for Linux129 $layer = 'WSL';130 }131 }132 return $layer;133 }134 public static function sw_hostname()135 {136 $hostname = 'Unknown';137 if(($bin = pts_client::executable_in_path('hostname')))138 {139 $hostname = trim(shell_exec($bin . ' 2>&1'));140 }141 else if(phodevi::is_windows())142 {143 $hostname = getenv('USERDOMAIN');144 }145 return $hostname;146 }147 public static function sw_vendor_identifier()148 {149 // Returns the vendor identifier used with the External Dependencies and other distro-specific features150 $vendor = phodevi::is_linux() ? phodevi_linux_parser::read_lsb_distributor_id() : false;151 if(!$vendor)152 {153 $vendor = phodevi::read_property('system', 'operating-system');154 if(($spos = strpos($vendor, ' ')) > 1)155 {156 $vendor = substr($vendor, 0, $spos);157 }158 }159 return str_replace(array(' ', '/'), '', strtolower($vendor));160 }161 public static function sw_filesystem()162 {163 // Determine file-system type164 $fs = null;165 if(phodevi::is_macos())166 {167 $fs = phodevi_osx_parser::read_osx_system_profiler('SPSerialATADataType', 'FileSystem', false, array('MS-DOS FAT32'));168 if($fs == null && pts_client::executable_in_path('mount'))169 {170 $mount = shell_exec('mount 2>&1');171 if(stripos($mount, ' on / (hfs, local, journaled)') !== false)172 {173 $fs = 'Journaled HFS+';174 }175 else if(stripos($mount, ' on / (hfs') !== false)176 {177 $fs = 'HFS+';178 }179 else if(stripos($mount, ' on / (apfs') !== false)180 {181 $fs = 'APFS';182 }183 }184 }185 else if(phodevi::is_bsd())186 {187 if(pts_client::executable_in_path('mount'))188 {189 $mount = shell_exec('mount 2>&1');190 if(($start = strpos($mount, 'on / (')) != false)191 {192 // FreeBSD, DragonflyBSD mount formatting193 /*194 -bash-4.0$ mount195 ROOT on / (hammer, local)196 /dev/da0s1a on /boot (ufs, local)197 /pfs/@@-1:00001 on /var (null, local)198 /pfs/@@-1:00002 on /tmp (null, local)199 /pfs/@@-1:00003 on /usr (null, local)200 /pfs/@@-1:00004 on /home (null, local)201 /pfs/@@-1:00005 on /usr/obj (null, local)202 /pfs/@@-1:00006 on /var/crash (null, local)203 /pfs/@@-1:00007 on /var/tmp (null, local)204 procfs on /proc (procfs, local)205 */206 // TODO: improve this in case there are other partitions, etc207 $fs = substr($mount, $start + 6);208 $fs = substr($fs, 0, strpos($fs, ','));209 }210 else if(($start = strpos($mount, 'on / type')) != false)211 {212 // OpenBSD 5.0 formatting is slightly different from above FreeBSD example213 // TODO: improve this in case there are other partitions, etc214 $fs = substr($mount, $start + 10);215 $fs = substr($fs, 0, strpos($fs, ' '));216 }217 }218 }219 else if(phodevi::is_hurd())220 {221 // Very rudimentary Hurd filesystem detection support but works for at least a clean Debian GNU/Hurd EXT2 install222 if(pts_client::executable_in_path('mount'))223 {224 $mount = shell_exec('mount 2>&1');225 if(($start = strpos($mount, 'on / type')) != false)226 {227 $fs = substr($mount, $start + 10);228 $fs = substr($fs, 0, strpos($fs, ' '));229 if(substr($fs, -2) == 'fs')230 {231 $fs = substr($fs, 0, -2);232 }233 }234 }235 }236 else if(phodevi::is_linux() || phodevi::is_solaris())237 {238 $fs = trim(shell_exec('stat ' . pts_client::test_install_root_path() . ' -L -f -c %T 2> /dev/null'));239 switch($fs)240 {241 case 'ext2/ext3':242 if(isset(phodevi::$vfs->mounts))243 {244 $fstab = phodevi::$vfs->mounts;245 $fstab = str_replace('/boot ', 'IGNORE', $fstab);246 $using_ext2 = strpos($fstab, ' ext2') !== false;247 $using_ext3 = strpos($fstab, ' ext3') !== false;248 $using_ext4 = strpos($fstab, ' ext4') !== false;249 if(!$using_ext2 && !$using_ext3 && $using_ext4)250 {251 $fs = 'ext4';252 }253 else if(!$using_ext2 && !$using_ext4 && $using_ext3)254 {255 $fs = 'ext3';256 }257 else if(!$using_ext3 && !$using_ext4 && $using_ext2)258 {259 $fs = 'ext2';260 }261 else if(is_dir('/proc/fs/ext4/'))262 {263 $fs = 'ext4';264 }265 else if(is_dir('/proc/fs/ext3/'))266 {267 $fs = 'ext3';268 }269 }270 break;271 case 'Case-sensitive Journaled HFS+':272 $fs = 'HFS+';273 break;274 case 'MS-DOS FAT32':275 $fs = 'FAT32';276 break;277 case 'UFSD_NTFS_COMPR':278 $fs = 'NTFS';279 break;280 case 'ecryptfs':281 if(isset(phodevi::$vfs->mounts))282 {283 // An easy attempt to determine what file-system is underneath ecryptfs if being compared284 // For now just attempt to figure out the root file-system.285 if(($s = strrpos(phodevi::$vfs->mounts, ' / ')) !== false)286 {287 $s = substr(phodevi::$vfs->mounts, ($s + 3));288 $s = substr($s, 0, strpos($s, ' '));289 if($s != null && !isset($s[18]) && $s != 'rootfs'&& pts_strings::string_only_contains($s, pts_strings::CHAR_LETTER | pts_strings::CHAR_NUMERIC))290 {291 $fs = $s . ' (ecryptfs)';292 }293 }294 }295 break;296 default:297 if(substr($fs, 0, 9) == 'UNKNOWN (')298 {299 $magic_block = substr($fs, 9, -1);300 $known_magic_blocks = array(301 '0x9123683e' => 'Btrfs',302 '0x2fc12fc1' => 'zfs', // KQ Infotech ZFS303 '0x482b' => 'HFS+',304 '0x65735546' => 'FUSE',305 '0x565a4653' => 'ReiserFS',306 '0x52345362' => 'Reiser4',307 '0x3434' => 'NILFS2',308 '0x5346414f' => 'OpenAFS',309 '0x47504653' => 'GPFS',310 '0x5941ff53' => 'YAFFS',311 '0xff534d42' => 'CIFS',312 '0x24051905' => 'UBIFS',313 '0x1021994' => 'TMPFS',314 '0x73717368' => 'SquashFS',315 '0xc97e8168' => 'LogFS',316 '0x5346544E' => 'NTFS',317 '0xf15f' => 'eCryptfs',318 '0x61756673' => 'AuFS',319 '0xbd00bd0' => 'Lustre',320 '0xaad7aaea' => 'PanFS', // Panasas FS321 '0xf2f52010' => 'F2FS',322 '0xc36400' => 'CephFS',323 '0x53464846' => 'WSLFS',324 '0xca451a4e' => 'BcacheFS'325 );326 foreach($known_magic_blocks as $hex => $name)327 {328 if($magic_block == $hex)329 {330 $fs = $name;331 break;332 }333 }334 }335 break;336 }337 if(strpos($fs, 'UNKNOWN') !== false && isset(phodevi::$vfs->mounts))338 {339 $mounts = phodevi::$vfs->mounts;340 $fs_r = array();341 $fs_checks = array(342 'squashfs' => 'SquashFS',343 'aufs' => 'AuFS',344 'unionfs' => 'UnionFS',345 'overlay' => 'overlayfs',346 );347 foreach($fs_checks as $fs_module => $fs_name)348 {349 if(strpos($mounts, $fs_module) != false)350 {351 array_push($fs_r, $fs_name);352 }353 }354 if(count($fs_r) > 0)355 {356 $fs = implode(' + ', $fs_r);357 }358 }359 }360 else if(phodevi::is_windows())361 {362 // TODO could use better detection to verify if C: or the desired disk under test... but most of the time will be NTFS anyways363 $fs = filter_var(trim(shell_exec('powershell -NoProfile "(Get-WMIObject -Class Win32_Volume | Select DriveLetter,FreeSpace,Capacity,DeviceID,Label,@{Name=\"FileSystemType\";Expression={$_.\"FileSystem\"}})[1].FileSystemType"')), FILTER_UNSAFE_RAW, FILTER_FLAG_STRIP_HIGH);364 if(empty($fs) || $fs == 'Unknown' || $fs == 'FAT32')365 {366 $fs = filter_var(trim(shell_exec('powershell -NoProfile "(Get-WMIObject -Class Win32_Volume | Select DriveLetter,FreeSpace,Capacity,DeviceID,Label,@{Name=\"FileSystemType\";Expression={$_.\"FileSystem\"}})[0].FileSystemType"')),FILTER_UNSAFE_RAW, FILTER_FLAG_STRIP_HIGH);367 }368 // Fallback for Windows 8369 if(empty($fs) || $fs == 'Unknown' || $fs == 'FAT32' || stripos($fs, 'not'))370 {371 if(strpos(shell_exec('fsutil fsinfo volumeinfo C:'), 'NTFS') !== false)372 {373 $fs = 'NTFS';374 }375 }376 }377 if(empty($fs))378 {379 $fs = 'Unknown';380 }381 return $fs;382 }383 public static function sw_virtualized_mode()384 {385 // Reports if system is running virtualized386 $virtualized = null;387 $mobo = phodevi::read_name('motherboard');388 $gpu = phodevi::read_name('gpu');389 $cpu = phodevi::read_property('cpu', 'model');390 if(strpos($cpu, 'QEMU') !== false || (is_readable('/sys/class/dmi/id/bios_vendor') && pts_file_io::file_get_contents('/sys/class/dmi/id/bios_vendor') == 'QEMU'))391 {392 $virtualized = 'QEMU';393 if(strpos($cpu, 'QEMU Virtual') !== false)394 {395 $qemu_version = substr($cpu, (strrpos($cpu, ' ') + 1));396 if(pts_strings::is_version($qemu_version))397 {398 $virtualized .= ' ' . $qemu_version;399 }400 }401 }402 else if(stripos($gpu, 'VMware') !== false || (is_readable('/sys/class/dmi/id/product_name') && stripos(pts_file_io::file_get_contents('/sys/class/dmi/id/product_name'), 'VMware') !== false))403 {404 $virtualized = 'VMware';405 }406 else if(stripos($gpu, 'VirtualBox') !== false || stripos(phodevi::read_name('motherboard'), 'VirtualBox') !== false)407 {408 $virtualized = 'VirtualBox';409 if($vbox_manage = pts_client::executable_in_path('VBoxManage'))410 {411 $vbox_manage = trim(shell_exec($vbox_manage . ' --version 2> /dev/null'));412 if(is_numeric(substr($vbox_manage, 0, 1)))413 {414 $virtualized .= ' ' . $vbox_manage;415 }416 }417 else if($modinfo = pts_client::executable_in_path('modinfo'))418 {419 $modinfo = trim(shell_exec('modinfo -F version vboxguest 2> /dev/null'));420 if($modinfo != null && pts_strings::is_version(str_ireplace(array('_', 'RC', 'beta'), '', $modinfo)))421 {422 $virtualized .= ' ' . $modinfo;423 }424 }425 }426 else if(is_file('/sys/class/dmi/id/sys_vendor') && pts_file_io::file_get_contents('/sys/class/dmi/id/sys_vendor') == 'Xen')427 {428 $virtualized = pts_file_io::file_get_contents('/sys/class/dmi/id/product_name');429 if(strpos($virtualized, 'Xen') === false)430 {431 $virtualized = 'Xen ' . $virtualized;432 }433 // version string434 $virtualized .= ' ' . pts_file_io::file_get_contents('/sys/class/dmi/id/product_version');435 // $virtualized should be then e.g. 'Xen HVM domU 4.1.1'436 }437 else if(stripos($gpu, 'Microsoft Hyper-V') !== false)438 {439 $virtualized = 'Microsoft Hyper-V Server';440 }441 else if(stripos($mobo, 'Parallels Software') !== false)442 {443 $virtualized = 'Parallels Virtualization';444 }445 else if(is_file('/sys/hypervisor/type'))446 {447 $type = pts_file_io::file_get_contents('/sys/hypervisor/type');448 $version = array();449 foreach(array('major', 'minor', 'extra') as $v)450 {451 if(is_file('/sys/hypervisor/version/' . $v))452 {453 $v = pts_file_io::file_get_contents('/sys/hypervisor/version/' . $v);454 }455 else456 {457 continue;458 }459 if($v != null)460 {461 if(!empty($version) && substr($v, 0, 1) != '.')462 {463 $v = '.' . $v;464 }465 array_push($version, $v);466 }467 }468 $virtualized = ucwords($type) . ' ' . implode('', $version) . ' Hypervisor';469 }470 if($systemd_virt = pts_client::executable_in_path('systemd-detect-virt'))471 {472 $systemd_virt = trim(shell_exec($systemd_virt . ' 2> /dev/null'));473 if($systemd_virt != null && $systemd_virt != 'none')474 {475 switch($systemd_virt)476 {477 case 'kvm':478 $systemd_virt = 'KVM';479 break;480 case 'oracle':481 $systemd_virt = 'Oracle';482 break;483 }484 if($virtualized != null && stripos($virtualized, $systemd_virt) === false && stripos($systemd_virt, $virtualized) === false)485 {486 $virtualized = $systemd_virt . ' ' . $virtualized;487 }488 else if($virtualized == null)489 {490 $virtualized = $systemd_virt;491 }492 }493 }494 if(empty($virtualized))495 {496 if(is_file('/.dockerenv'))497 {498 $virtualized = 'Docker';499 }500 else if(is_file('/dev/lxc/console'))501 {502 $virtualized = 'lxc';503 }504 }505 return $virtualized;506 }507 public static function sw_environment_variables()508 {509 $check_variables = array('LIBGL', '__GL', 'DRI_', 'DEBUG', 'FLAGS', 'PERF_', 'PERFTEST');510 $to_report = array();511 if(stripos(phodevi::read_property('system', 'opengl-driver'), 'Mesa'))512 {513 array_push($check_variables, 'MESA', 'GALLIUM');514 }515 if(isset($_SERVER))516 {517 foreach($_SERVER as $name => &$value)518 {519 foreach($check_variables as $var)520 {521 if(stripos($name, $var) !== false && $name != '__GL_SYNC_TO_VBLANK' && strpos($name, 'GJS') === false)522 {523 $value = trim($value);524 if(strpos($value, ' ') !== false)525 {526 $value = '"' . $value . '"';527 }528 array_push($to_report, $name . '=' . $value);529 break;530 }531 }532 }533 }534 return implode(' ', array_unique($to_report));535 }536 public static function sw_security_features()537 {538 $security = array();539 if(pts_client::executable_in_path('getenforce'))540 {541 $selinux = shell_exec('getenforce 2>&1');542 if(strpos($selinux, 'Enforcing') !== false)543 {544 $security[] = 'SELinux';545 }546 }547 // Meltdown / KPTI check548 if(phodevi::is_linux())549 {550 /* if(strpos(phodevi::$vfs->dmesg, 'page tables isolation: enabled') !== false)551 {552 // Kernel Page Table Isolation553 $security[] = 'KPTI';554 }555*/556 // Spectre557 foreach(pts_file_io::glob('/sys/devices/system/cpu/vulnerabilities/*') as $vuln)558 {559 $fc = file_get_contents($vuln);560 $fc = str_replace('Mitigation: ', 'Mitigation of ', $fc);561 $fc = str_replace('Speculative Store Bypass', 'SSB', $fc);562 if(!empty($fc))563 {564 $security[] = basename($vuln) . ': ' . $fc;565 }566 }567 }568 else if(phodevi::is_bsd())569 {570 // FreeBSD571 if(phodevi_bsd_parser::read_sysctl('vm.pmap.pti') == '1')572 {573 $security[] = 'KPTI';574 }575 if(phodevi_bsd_parser::read_sysctl('hw.ibrs_active') == '1')576 {577 $security[] = 'IBRS';578 }579 // DragonFlyBSD580 if(($spectre = phodevi_bsd_parser::read_sysctl('machdep.spectre_mitigation')) != '0' && $spectre != 'NONE' && !empty($spectre))581 {582 $security[] = 'Spectre ' . $spectre . ' Mitigation';583 }584 if(phodevi_bsd_parser::read_sysctl('machdep.meltdown_mitigation') == '1')585 {586 $security[] = 'Meltdown Mitigation';587 }588 }589 else if(phodevi::is_windows())590 {591 $mds_tool = microsoft_dependency_handler::file_download_location() . 'mdstool-cli.exe';592 if(is_file($mds_tool))593 {594 $mds_output = preg_replace('#\\x1b[[][^A-Za-z]*[A-Za-z]#', '', shell_exec($mds_tool));595 //echo PHP_EOL;596 foreach(array('__user pointer sanitization: Disabled', 'Retpoline: Full', 'IBPB: Always', 'IBRS: Enabled', 'STIBP: Enabled', 'KPTI Enabled: Yes', 'PTE Inversion: Yes') as $check)597 {598 if(stripos($mds_output, $check) !== false)599 {600 $security[] = $check;601 }602 }603 }604 // Windows 10+ security features: VBS, HVCI605 // https://docs.microsoft.com/en-us/windows/security/threat-protection/device-guard/enable-virtualization-based-protection-of-code-integrity#virtualizationbasedsecuritystatus606 $vbs_status = trim(shell_exec('powershell -NoProfile "(Get-CimInstance -ErrorAction SilentlyContinue –ClassName Win32_DeviceGuard –Namespace root\Microsoft\Windows\DeviceGuard).VirtualizationBasedSecurityStatus"'));607 switch($vbs_status) {608 case '0':609 $security[] = 'VBS: Disabled';610 break;611 case '1':612 $security[] = 'VBS: Enabled but not running';613 break;614 case '2':615 $security[] = 'VBS: Enabled and running';616 break;617 }618 // https://docs.microsoft.com/en-us/windows/security/threat-protection/device-guard/enable-virtualization-based-protection-of-code-integrity#securityservicesconfigured619 $security_services_running = preg_split('/\r\n|\n|\r/', trim(shell_exec('powershell -NoProfile "(Get-CimInstance -ErrorAction SilentlyContinue –ClassName Win32_DeviceGuard –Namespace root\Microsoft\Windows\DeviceGuard).SecurityServicesRunning"')));620 if(in_array('2', $security_services_running)) {621 $security[] = 'HVCI: Running';622 // Mode Based Execution Control (MBEC) is relevant to HVCI performance and is available in Intel Kaby Lake and newer and AMD Zen 2 and newer623 // https://docs.microsoft.com/en-us/windows/security/threat-protection/device-guard/enable-virtualization-based-protection-of-code-integrity#hvci-features624 // https://docs.microsoft.com/en-us/windows/security/threat-protection/device-guard/enable-virtualization-based-protection-of-code-integrity#availablesecurityproperties625 $available_security_properties = preg_split('/\r\n|\n|\r/', trim(shell_exec('powershell -NoProfile "(Get-CimInstance -ErrorAction SilentlyContinue –ClassName Win32_DeviceGuard –Namespace root\Microsoft\Windows\DeviceGuard).AvailableSecurityProperties"')));626 if(in_array('7', $available_security_properties)) {627 $security[] = 'MBEC: Available';628 } else {629 $security[] = 'MBEC: Unavailable';630 }631 }632 }633 return !empty($security) ? implode(' + ', $security) : null;634 }635 public static function sw_compiler()636 {637 // Returns version of the compiler (if present)638 $compilers = array();639 if($gcc = pts_client::executable_in_path('gcc'))640 {...

Full Screen

Full Screen

properties

Using AI Code Generation

copy

Full Screen

1$system = new phodevi_system();2$system->properties();3$system->sensors();4$system = new phodevi_system();5$sensor = new phodevi_sensor();6$sensor->sensors();7$sensor->properties();8$sensor->sensors();9$sensor->properties();10$sensor->sensors();11$sensor->properties();12$sensor->sensors();13$sensor->properties();14$sensor->sensors();15$sensor->properties();16$sensor->sensors();17$sensor->properties();18$sensor->sensors();19$sensor->properties();20$sensor->sensors();21$sensor->properties();22$sensor->sensors();

Full Screen

Full Screen

properties

Using AI Code Generation

copy

Full Screen

1$sys = new phodevi_system();2echo $sys->properties['cpu']['model'];3$sensor = new phodevi_sensor();4echo $sensor->properties['cpu']['temperature'];5$net = new phodevi_network();6echo $net->properties['network']['upload'];7$hw = new phodevi_hardware();8echo $hw->properties['motherboard']['model'];9$sw = new phodevi_software();10echo $sw->properties['kernel']['version'];11$vfs = new phodevi_vfs();12echo $vfs->properties['vfs']['mount-points'];13$dev = new phodevi_device();14echo $dev->properties['device']['type'];15$virt = new phodevi_virtualization();16echo $virt->properties['virtualization']['type'];17$os = new phodevi_os();18echo $os->properties['os']['type'];19$disp = new phodevi_display();20echo $disp->properties['display']['resolution'];21$gpu = new phodevi_gpu();22echo $gpu->properties['gpu']['model'];23$aud = new phodevi_audio();24echo $aud->properties['audio']['model'];25$inp = new phodevi_input();26echo $inp->properties['input']['keyboard'];27$bio = new phodevi_bios();28echo $bio->properties['bios']['vendor'];29$sto = new phodevi_storage();30echo $sto->properties['storage']['devices'];

Full Screen

Full Screen

properties

Using AI Code Generation

copy

Full Screen

1$phodevi = new phodevi_system();2$phodevi->properties();3echo $phodevi->properties['kernel'];4echo $phodevi->properties['kernel-version'];5echo $phodevi->properties['kernel-release'];6echo $phodevi->properties['kernel-architecture'];7echo $phodevi->properties['kernel-architecture-bits'];8echo $phodevi->properties['kernel-architecture-bits'];9echo $phodevi->properties['kernel-architecture-bits'];10echo $phodevi->properties['kernel-architecture-bits'];11$phodevi = new phodevi_system();12$phodevi->properties();13echo $phodevi->properties['kernel'];14echo $phodevi->properties['kernel-version'];15echo $phodevi->properties['kernel-release'];16echo $phodevi->properties['kernel-architecture'];17echo $phodevi->properties['kernel-architecture-bits'];18echo $phodevi->properties['kernel-architecture-bits'];19echo $phodevi->properties['kernel-architecture-bits'];20echo $phodevi->properties['kernel-architecture-bits'];21$phodevi = new phodevi_system();22$phodevi->properties();23echo $phodevi->properties['kernel'];24echo $phodevi->properties['kernel-version'];25echo $phodevi->properties['kernel-release'];26echo $phodevi->properties['kernel-architecture'];27echo $phodevi->properties['kernel-architecture-bits'];28echo $phodevi->properties['kernel-architecture-bits'];29echo $phodevi->properties['kernel-architecture-bits'];30echo $phodevi->properties['kernel-architecture-bits'];31$phodevi = new phodevi_system();32$phodevi->properties();33echo $phodevi->properties['kernel'];34echo $phodevi->properties['kernel-version'];35echo $phodevi->properties['kernel-release'];36echo $phodevi->properties['kernel-architecture'];37echo $phodevi->properties['kernel-architecture-bits'];

Full Screen

Full Screen

properties

Using AI Code Generation

copy

Full Screen

1require_once('/usr/share/php/phodevi/system.php');2echo phodevi::system()->properties->get('cpu', 'model');3echo phodevi::system()->properties->get('cpu', 'frequency');4echo phodevi::system()->properties->get('cpu', 'core-count');5echo phodevi::system()->properties->get('cpu', 'load');6echo phodevi::system()->properties->get('cpu', 'usage');7echo phodevi::system()->properties->get('cpu', 'temperature');8echo phodevi::system()->properties->get('cpu', 'voltage');9echo phodevi::system()->properties->get('cpu', 'power');10echo phodevi::system()->properties->get('cpu', 'power-consumption');11echo phodevi::system()->properties->get('cpu', 'power-consumption-delta');12echo phodevi::system()->properties->get('cpu', 'power-consumption-delta-avg');13echo phodevi::system()->properties->get('cpu', 'power-consumption-delta-max');14echo phodevi::system()->properties->get('cpu', 'power-consumption-delta-min');15echo phodevi::system()->properties->get('cpu', 'power-consumption-delta-stddev');16echo phodevi::system()->properties->get('cpu', 'energy-consumption');17echo phodevi::system()->properties->get('cpu', 'energy-consumption-delta');18echo phodevi::system()->properties->get('cpu', 'energy-consumption-delta-avg');19echo phodevi::system()->properties->get('cpu', 'energy-consumption-delta-max');20echo phodevi::system()->properties->get('cpu', 'energy-consumption-delta-min');21echo phodevi::system()->properties->get('cpu', 'energy-consumption-delta-stddev');22echo phodevi::system()->properties->get('cpu', 'energy-consumption-rate');23echo phodevi::system()->properties->get('cpu', 'energy-consumption-rate-delta');24echo phodevi::system()->properties->get('cpu', 'energy-consumption-rate-delta-avg');25echo phodevi::system()->properties->get('cpu', 'energy-consumption-rate-delta-max');

Full Screen

Full Screen

properties

Using AI Code Generation

copy

Full Screen

1$phodevi = new phodevi_system();2$phodevi->properties();3echo $phodevi->system->kernel->version;4echo $phodevi->system->kernel->release;5echo $phodevi->system->kernel->architecture;6echo $phodevi->system->kernel->bits;7echo $phodevi->system->kernel->compiler;8echo $phodevi->system->kernel->compiler_version;9echo $phodevi->system->kernel->compiler_date;10echo $phodevi->system->kernel->compiler_flags;11echo $phodevi->system->kernel->compiler_flags_c;12echo $phodevi->system->kernel->compiler_flags_cpp;13echo $phodevi->system->kernel->compiler_flags_fortran;14echo $phodevi->system->kernel->compiler_flags_link;15echo $phodevi->system->kernel->compiler_flags_link_c;16echo $phodevi->system->kernel->compiler_flags_link_cpp;17echo $phodevi->system->kernel->compiler_flags_link_fortran;18echo $phodevi->system->kernel->compiler_flags_link_shared;19echo $phodevi->system->kernel->compiler_flags_link_static;20echo $phodevi->system->kernel->compiler_flags_link_executable;21echo $phodevi->system->kernel->compiler_flags_link_library;22echo $phodevi->system->kernel->compiler_flags_link_object;23echo $phodevi->system->kernel->compiler_flags_link_module;24echo $phodevi->system->kernel->compiler_flags_link_shared_object;25echo $phodevi->system->kernel->compiler_flags_link_static_library;26echo $phodevi->system->kernel->compiler_flags_link_static_object;27echo $phodevi->system->kernel->compiler_flags_link_static_module;28echo $phodevi->system->kernel->compiler_flags_link_executable;29echo $phodevi->system->kernel->compiler_flags_link_library;30echo $phodevi->system->kernel->compiler_flags_link_object;31echo $phodevi->system->kernel->compiler_flags_link_module;32echo $phodevi->system->kernel->compiler_flags_link_shared_object;33echo $phodevi->system->kernel->compiler_flags_link_static_library;34echo $phodevi->system->kernel->compiler_flags_link_static_object;

Full Screen

Full Screen

properties

Using AI Code Generation

copy

Full Screen

1require_once("phodevi.php");2$system = new phodevi_system();3$system->load();4echo $system->properties['cpu']['brand'];5echo $system->properties['cpu']['model'];6echo $system->properties['cpu']['speed'];7echo $system->properties['cpu']['cores'];8echo $system->properties['cpu']['threads'];9echo $system->properties['cpu']['cache'];10echo $system->properties['cpu']['l1data'];11echo $system->properties['cpu']['l1instruction'];12echo $system->properties['cpu']['l2'];13echo $system->properties['cpu']['l3'];14echo $system->properties['cpu']['l4'];15echo $system->properties['cpu']['l1data']['size'];16echo $system->properties['cpu']['l1data']['associativity'];17echo $system->properties['cpu']['l1data']['linesize'];18echo $system->properties['cpu']['l1data']['sets'];19echo $system->properties['cpu']['l1instruction']['size'];20echo $system->properties['cpu']['l1instruction']['associativity'];21echo $system->properties['cpu']['l1instruction']['linesize'];22echo $system->properties['cpu']['l1instruction']['sets'];23echo $system->properties['cpu']['l2']['size'];24echo $system->properties['cpu']['l2']['associativity'];25echo $system->properties['cpu']['l2']['linesize'];26echo $system->properties['cpu']['l2']['sets'];27echo $system->properties['cpu']['l3']['size'];28echo $system->properties['cpu']['l3']['associativity'];29echo $system->properties['cpu']['l3']['linesize'];30echo $system->properties['cpu']['l3']['sets'];31echo $system->properties['cpu']['l4']['size'];32echo $system->properties['cpu']['l4']['associativity'];33echo $system->properties['cpu']['l4']['linesize'];34echo $system->properties['cpu']['l4']['sets'];35echo $system->properties['cpu']['l1data']['size']['human'];36echo $system->properties['cpu']['l1data']['size']['bytes'];37echo $system->properties['cpu']['l1data']['size']['kilobytes'];38echo $system->properties['cpu']['l1data']['size']['megabytes'];

Full Screen

Full Screen

properties

Using AI Code Generation

copy

Full Screen

1include_once('/usr/share/php/phodevi/system.php');2$system = new phodevi_system();3$property = $system->get_property('os');4echo $property;5include_once('/usr/share/php/phodevi/system.php');6$system = new phodevi_system();7$property = $system->get_property('os');8echo $property;9include_once('/usr/share/php/phodevi/system.php');10$system = new phodevi_system();11$property = $system->get_property('os');12echo $property;13include_once('/usr/share/php/phodevi/system.php');14$system = new phodevi_system();15$property = $system->get_property('os');16echo $property;17include_once('/usr/share/php/phodevi/system.php');18$system = new phodevi_system();19$property = $system->get_property('os');20echo $property;21include_once('/usr/share/php/phodevi/system.php');22$system = new phodevi_system();23$property = $system->get_property('os');24echo $property;25include_once('/usr/share/php/phodevi/system.php');26$system = new phodevi_system();27$property = $system->get_property('os');28echo $property;29include_once('/usr/share/php/phodevi/system.php');30$system = new phodevi_system();31$property = $system->get_property('os');32echo $property;33include_once('/usr/share/php/phodevi/system

Full Screen

Full Screen

properties

Using AI Code Generation

copy

Full Screen

1include_once('phodevi.php');2$system = new phodevi_system();3$system->properties();4echo $system->get_property('kernel');5echo $system->get_property('distribution');6echo $system->get_property('distribution-type');7echo $system->get_property('distribution-version');8echo $system->get_property('distribution-version-major');9echo $system->get_property('distribution-version-minor');10echo $system->get_property('distribution-version-revision');11echo $system->get_property('distribution-version-build');12echo $system->get_property('distribution-version-branch');13echo $system->get_property('distribution-version-branch-alias');14echo $system->get_property('distribution-version-alias');15echo $system->get_property('distribution-version-alias-short');16echo $system->get_property('distribution-codename');17echo $system->get_property('distribution-release');18echo $system->get_property('distribution-architecture');19echo $system->get_property('distribution-architecture-bits');20echo $system->get_property('distribution-architecture-endian');21echo $system->get_property('distribution-architecture-type');22echo $system->get_property('distribution-architecture-alias');23echo $system->get_property('distribution-architecture-alias-short');24echo $system->get_property('distribution-architecture-alias-micro');25echo $system->get_property('distribution-architecture-alias-micro-short');26echo $system->get_property('distribution-architecture-alias-micro-short-pretty');27echo $system->get_property('distribution-architecture-alias-pretty');28echo $system->get_property('distribution-architecture-alias-short-pretty');29echo $system->get_property('distribution-architecture-pretty');30echo $system->get_property('distribution-architecture-pretty-short');31echo $system->get_property('distribution-architecture-pretty-short-alias');32echo $system->get_property('distribution-architecture-pretty-alias');33echo $system->get_property('distribution-architecture-pretty-alias-short');34echo $system->get_property('distribution-architecture-pretty-alias-short-micro');35echo $system->get_property('distribution-architecture-pretty-alias-short-micro-short');36echo $system->get_property('distribution-architecture-pretty-alias-short-micro-short-pretty');37echo $system->get_property('distribution-architecture-pretty-alias-short-micro-short-pretty-alias');

Full Screen

Full Screen

properties

Using AI Code Generation

copy

Full Screen

1require_once('phodevi.php');2$phodevi = new phodevi_system();3$phodevi->properties();4echo 'The system is '.$phodevi->system.' '.$phodevi->system_version.' '.$phodevi->system_architecture.' '.$phodevi->system_kernel.'<br>';5echo 'The CPU is '.$phodevi->cpu_model.' '.$phodevi->cpu_architecture.' '.$phodevi->cpu_cores.' cores<br>';6echo 'The GPU is '.$phodevi->gpu_model.'<br>';7echo 'The motherboard is '.$phodevi->motherboard.'<br>';8echo 'The RAM is '.$phodevi->ram_model.' '.$phodevi->ram_capacity.'<br>';9echo 'The storage is '.$phodevi->storage_model.' '.$phodevi->storage_capacity.'<br>';10The CPU is Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz x86_64 4 cores<br>11require_once('phodevi.php');12$phodevi = new phodevi_system();13$phodevi->sensors();

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful