当前位置: 首页>>代码示例>>PHP>>正文


PHP phodevi::is_linux方法代码示例

本文整理汇总了PHP中phodevi::is_linux方法的典型用法代码示例。如果您正苦于以下问题:PHP phodevi::is_linux方法的具体用法?PHP phodevi::is_linux怎么用?PHP phodevi::is_linux使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在phodevi的用法示例。


在下文中一共展示了phodevi::is_linux方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: network_device_string

 public static function network_device_string()
 {
     $network = array();
     if (phodevi::is_macosx()) {
         // TODO: implement
     } else {
         if (phodevi::is_bsd()) {
             foreach (array('dev.em.0.%desc', 'dev.wpi.0.%desc', 'dev.mskc.0.%desc') as $controller) {
                 $pci = phodevi_bsd_parser::read_sysctl($controller);
                 if (!empty($pci)) {
                     array_push($network, $pci);
                 }
             }
         } else {
             if (phodevi::is_windows()) {
                 // TODO: implement
             } else {
                 if (phodevi::is_linux()) {
                     foreach (array('Ethernet controller', 'Network controller') as $controller) {
                         $pci = phodevi_linux_parser::read_pci($controller);
                         if (!empty($pci)) {
                             array_push($network, $pci);
                         }
                     }
                 }
             }
         }
     }
     return implode(' + ', $network);
 }
开发者ID:ShaolongHu,项目名称:phoronix-test-suite,代码行数:30,代码来源:phodevi_network.php

示例2: __pre_run_process

 public static function __pre_run_process()
 {
     self::$error_count = 0;
     self::$error_pointer = 0;
     self::$error_analysis = array();
     // Store the video resolution
     // Access the xrandr resolution directly to ensure it's not polling the FB size or one of the KMS modes
     self::$start_video_resolution = phodevi_gpu::gpu_xrandr_resolution();
     if (phodevi::is_linux() && phodevi::is_ati_graphics()) {
         $vsync_val = phodevi_linux_parser::read_amd_pcsdb('AMDPCSROOT/SYSTEM/BUSID-*/OpenGL,VSyncControl');
         // Check for vSync
         if ($vsync_val == '0x00000002' || $vsync_val == '0x00000003') {
             self::$driver_forced_vsync = true;
         }
         //$catalyst_ai_val = phodevi_linux_parser::read_amd_pcsdb('AMDPCSROOT/SYSTEM/BUSID-*/OpenGL,CatalystAI'); // Check for Catalyst AI
         //if($catalyst_ai_val == '0x00000001' || $catalyst_ai_val == '0x00000002')
         //	echo '\nCatalyst AI is enabled, which will use driver-specific optimizations in some tests that may offer extra performance enhancements.\n';
     } else {
         if (phodevi::is_nvidia_graphics()) {
             self::$error_pointer = self::nvidia_gpu_error_count();
             // Set the error pointer
             if (phodevi_parser::read_nvidia_extension('SyncToVBlank') == '1') {
                 shell_exec('nvidia-settings -a SyncToVBlank=0 2>&1');
                 self::$driver_forced_vsync = true;
             }
         }
     }
     if (self::$driver_forced_vsync == true) {
         //	echo '\nYour video driver is forcing vertical sync to be enabled. This will limit the system's frame-rate performance potential in any graphical tests!\n';
     }
     // vblank_mode=0 has long been set within pts-core, but put it here too just since there's these other checks here
     putenv('vblank_mode=0');
 }
开发者ID:QueenGirl,项目名称:phoronix-test-suite,代码行数:33,代码来源:graphics_event_checker.php

示例3: read_sensor

 public function read_sensor()
 {
     $voltage = -1;
     if (phodevi::is_linux()) {
         $voltage = $this->cpu_voltage_linux();
     }
     return $voltage;
 }
开发者ID:ptzafrir,项目名称:phoronix-test-suite,代码行数:8,代码来源:cpu_voltage.php

示例4: read_sensor

 public function read_sensor()
 {
     $fan_speed = -1;
     if (phodevi::is_linux()) {
         $fan_speed = $this->sys_fanspeed_linux();
     }
     return $fan_speed;
 }
开发者ID:ShaolongHu,项目名称:phoronix-test-suite,代码行数:8,代码来源:sys_fanspeed.php

示例5: read_sensor

 public function read_sensor()
 {
     $swap_usage = -1;
     if (phodevi::is_linux()) {
         $swap_usage = self::swap_usage_linux();
     }
     return $swap_usage;
 }
开发者ID:numerant,项目名称:phoronix-test-suite,代码行数:8,代码来源:swap_usage.php

示例6: read_sensor

 public function read_sensor()
 {
     $temp = -1;
     if (phodevi::is_linux()) {
         $temp = $this->hdd_temp_linux();
     }
     return pts_math::set_precision($temp, 2);
 }
开发者ID:numerant,项目名称:phoronix-test-suite,代码行数:8,代码来源:hdd_temp.php

示例7: read_sensor

 public function read_sensor()
 {
     $write_speed = -1;
     if (phodevi::is_linux()) {
         $write_speed = $this->hdd_write_speed_linux();
     }
     return pts_math::set_precision($write_speed, 2);
 }
开发者ID:ShaolongHu,项目名称:phoronix-test-suite,代码行数:8,代码来源:hdd_write_speed.php

示例8: read_sensor

 public function read_sensor()
 {
     $iowait = -1;
     if (phodevi::is_linux()) {
         $iowait = $this->sys_iowait_linux();
     }
     return $iowait;
 }
开发者ID:ShaolongHu,项目名称:phoronix-test-suite,代码行数:8,代码来源:sys_iowait.php

示例9: mem_usage

 private function mem_usage()
 {
     if (phodevi::is_linux()) {
         return self::mem_usage_linux();
     } elseif (phodevi::is_macosx() || phodevi::is_bsd()) {
         return self::mem_usage_bsd('MEMORY', 'USED');
     }
 }
开发者ID:ptzafrir,项目名称:phoronix-test-suite,代码行数:8,代码来源:memory_usage.php

示例10: read_sensor

 public function read_sensor()
 {
     if (phodevi::is_linux()) {
         return $this->cpu_power_linux();
     }
     return -1;
     // TODO make -1 a named constant
 }
开发者ID:ShaolongHu,项目名称:phoronix-test-suite,代码行数:8,代码来源:cpu_power.php

示例11: read_sensor

 public static function read_sensor()
 {
     // Read the processor temperature
     $temp_c = -1;
     if (phodevi::is_bsd()) {
         $cpu_temp = phodevi_bsd_parser::read_sysctl(array('hw.sensors.acpi_tz0.temp0', 'dev.cpu.0.temperature', 'hw.sensors.cpu0.temp0'));
         if ($cpu_temp != false) {
             if (($end = strpos($cpu_temp, 'degC')) || ($end = strpos($cpu_temp, 'C')) > 0) {
                 $cpu_temp = substr($cpu_temp, 0, $end);
             }
             if (is_numeric($cpu_temp)) {
                 $temp_c = $cpu_temp;
             }
         } else {
             $acpi = phodevi_bsd_parser::read_sysctl('hw.acpi.thermal.tz0.temperature');
             if (($end = strpos($acpi, 'C')) > 0) {
                 $acpi = substr($acpi, 0, $end);
             }
             if (is_numeric($acpi)) {
                 $temp_c = $acpi;
             }
         }
     } else {
         if (phodevi::is_linux()) {
             // Try hwmon interface
             $raw_temp = phodevi_linux_parser::read_sysfs_node('/sys/class/hwmon/hwmon*/device/temp1_input', 'POSITIVE_NUMERIC', array('name' => 'coretemp'));
             if ($raw_temp == -1) {
                 $raw_temp = phodevi_linux_parser::read_sysfs_node('/sys/class/hwmon/hwmon*/device/temp1_input', 'POSITIVE_NUMERIC', array('name' => 'k10temp'));
             }
             if ($raw_temp == -1) {
                 // Try ACPI thermal
                 // Assuming the system thermal sensor comes 2nd to the ACPI CPU temperature
                 // It appears that way on a ThinkPad T60, but TODO find a better way to validate
                 $raw_temp = phodevi_linux_parser::read_sysfs_node('/sys/class/thermal/thermal_zone*/temp', 'POSITIVE_NUMERIC', null, 2);
             }
             if ($raw_temp != -1) {
                 if ($raw_temp > 1000) {
                     $raw_temp = $raw_temp / 1000;
                 }
                 $temp_c = pts_math::set_precision($raw_temp, 2);
             }
             if ($temp_c == -1) {
                 // Try LM_Sensors
                 $sensors = phodevi_linux_parser::read_sensors(array('CPU Temp', 'Core 0', 'Core0 Temp', 'Core1 Temp'));
                 if ($sensors != false && is_numeric($sensors) && $sensors > 0) {
                     $temp_c = $sensors;
                 }
             }
             if (pts_client::executable_in_path('ipmitool')) {
                 $ipmi = phodevi_linux_parser::read_ipmitool_sensor('Temp 0');
                 if ($ipmi > 0 && is_numeric($ipmi)) {
                     $temp_c = $ipmi;
                 }
             }
         }
     }
     return $temp_c;
 }
开发者ID:rkingsbury,项目名称:phoronix-test-suite,代码行数:58,代码来源:cpu_temp.php

示例12: read_sensor

 public static function read_sensor()
 {
     if (phodevi::is_linux()) {
         $sensor = phodevi_linux_parser::read_sensors('VCore');
     } else {
         $sensor = -1;
     }
     return $sensor;
 }
开发者ID:rkingsbury,项目名称:phoronix-test-suite,代码行数:9,代码来源:cpu_voltage.php

示例13: read_sensor

 public static function read_sensor()
 {
     if (phodevi::is_linux()) {
         $sensor = phodevi_linux_parser::read_sensors(array('V5', '+5V'));
     } else {
         $sensor = -1;
     }
     return $sensor;
 }
开发者ID:rkingsbury,项目名称:phoronix-test-suite,代码行数:9,代码来源:sys_v5.php

示例14: read_sensor

 public function read_sensor()
 {
     $sys_temp = -1;
     if (phodevi::is_linux()) {
         $sys_temp = $this->sys_temp_linux();
     } elseif (phodevi::is_bsd()) {
         $sys_temp = $this->sys_temp_bsd();
     }
     return $sys_temp;
 }
开发者ID:ShaolongHu,项目名称:phoronix-test-suite,代码行数:10,代码来源:sys_temp.php

示例15: __run_manager_setup

 public static function __run_manager_setup(&$test_run_manager)
 {
     // Verify LINUX_PERF is set, `perf` can be found, and is Linux
     if (getenv('LINUX_PERF') == 0 || !pts_client::executable_in_path('perf') || !phodevi::is_linux()) {
         return pts_module::MODULE_UNLOAD;
         // This module doesn't have anything else to do
     }
     echo PHP_EOL . 'Linux PERF Monitoring Enabled.' . PHP_EOL . PHP_EOL;
     // This module won't be too useful if you're not saving the results to see the graphs
     $test_run_manager->force_results_save();
 }
开发者ID:ShaolongHu,项目名称:phoronix-test-suite,代码行数:11,代码来源:linux_perf.php


注:本文中的phodevi::is_linux方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。