本文整理汇总了PHP中phodevi::is_product_string方法的典型用法代码示例。如果您正苦于以下问题:PHP phodevi::is_product_string方法的具体用法?PHP phodevi::is_product_string怎么用?PHP phodevi::is_product_string使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类phodevi
的用法示例。
在下文中一共展示了phodevi::is_product_string方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: gpu_model
public static function gpu_model()
{
// Report graphics processor string
$info = phodevi_parser::read_glx_renderer();
$video_ram = phodevi::read_property('gpu', 'memory-capacity');
if (phodevi::is_ati_graphics() && phodevi::is_linux()) {
$crossfire_status = phodevi_linux_parser::read_amd_pcsdb('SYSTEM/Crossfire/chain/*,Enable');
$crossfire_status = pts_arrays::to_array($crossfire_status);
$crossfire_card_count = 0;
for ($i = 0; $i < count($crossfire_status); $i++) {
if ($crossfire_status[$i] == '0x00000001') {
$crossfire_card_count += 2;
// For now assume each chain is 2 cards, but proper way would be NumSlaves + 1
}
}
$adapters = phodevi_linux_parser::read_amd_graphics_adapters();
if (count($adapters) > 0) {
$video_ram = $video_ram > 64 ? ' ' . $video_ram . 'MB' : null;
// assume more than 64MB of vRAM
if ($crossfire_card_count > 1 && $crossfire_card_count <= count($adapters)) {
$unique_adapters = array_unique($adapters);
if (count($unique_adapters) == 1) {
if (strpos($adapters[0], 'X2') > 0 && $crossfire_card_count > 1) {
$crossfire_card_count -= 1;
}
$info = $crossfire_card_count . ' x ' . $adapters[0] . $video_ram . ' CrossFire';
} else {
$info = implode(', ', $unique_adapters) . ' CrossFire';
}
} else {
$info = $adapters[0] . $video_ram;
}
}
} else {
if (phodevi::is_macosx()) {
$system_profiler_info = implode(' + ', phodevi_osx_parser::read_osx_system_profiler('SPDisplaysDataType', 'ChipsetModel', true));
if (!empty($system_profiler_info)) {
$info = $system_profiler_info;
}
} else {
if (phodevi::is_nvidia_graphics()) {
if ($info == null) {
if (pts_client::executable_in_path('nvidia-settings')) {
$nv_gpus = shell_exec('nvidia-settings -q gpus 2>&1');
// TODO: search for more than one GPU
$nv_gpus = substr($nv_gpus, strpos($nv_gpus, '[0]'));
$nv_gpus = substr($nv_gpus, strpos($nv_gpus, '(') + 1);
$nv_gpus = substr($nv_gpus, 0, strpos($nv_gpus, ')'));
if (stripos($nv_gpus, 'GeForce') !== false || stripos($nv_gpus, 'Quadro') !== false) {
$info = $nv_gpus;
}
}
}
$sli_mode = phodevi_parser::read_nvidia_extension('SLIMode');
if (!empty($sli_mode) && $sli_mode != 'Off') {
$info .= ' SLI';
}
} else {
if (phodevi::is_solaris()) {
if (($cut = strpos($info, 'DRI ')) !== false) {
$info = substr($info, $cut + 4);
}
if (($cut = strpos($info, ' Chipset')) !== false) {
$info = substr($info, 0, $cut);
}
if ($info == false && isset(phodevi::$vfs->xorg_log)) {
$xorg_log = phodevi::$vfs->xorg_log;
if (($x = strpos($xorg_log, '(0): Chipset: ')) !== false) {
$xorg_log = substr($xorg_log, $x + 14);
$xorg_log = str_replace(array('(R)', '"'), null, substr($xorg_log, 0, strpos($xorg_log, PHP_EOL)));
if (($c = strpos($xorg_log, '[')) || ($c = strpos($xorg_log, '('))) {
$xorg_log = substr($xorg_log, 0, $c);
}
if (phodevi::is_product_string($xorg_log)) {
$info = $xorg_log;
}
}
}
} else {
if (phodevi::is_bsd()) {
$drm_info = phodevi_bsd_parser::read_sysctl('dev.drm.0.%desc');
if (!$drm_info) {
$drm_info = phodevi_bsd_parser::read_sysctl('dev.nvidia.0.%desc');
}
if (!$drm_info) {
$agp_info = phodevi_bsd_parser::read_sysctl('dev.agp.0.%desc');
if ($agp_info != false) {
$info = $agp_info;
}
} else {
$info = $drm_info;
}
if ($info == null && isset(phodevi::$vfs->xorg_log)) {
$xorg_log = phodevi::$vfs->xorg_log;
if (($e = strpos($xorg_log, ' at 01@00:00:0')) !== false) {
$xorg_log = substr($xorg_log, 0, $e);
$info = substr($xorg_log, strrpos($xorg_log, 'Found ') + 6);
}
}
} else {
//.........这里部分代码省略.........