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


PHP phodevi::operating_system方法代码示例

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


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

示例1: generate_download_object_list

 public function generate_download_object_list($do_file_checks = true)
 {
     $download_xml_file = $this->test_profile->get_file_download_spec();
     if ($download_xml_file != null) {
         $xml_parser = new pts_test_downloads_nye_XmlReader($download_xml_file);
         $package_url = $xml_parser->getXMLArrayValues('PhoronixTestSuite/Downloads/Package/URL');
         $package_md5 = $xml_parser->getXMLArrayValues('PhoronixTestSuite/Downloads/Package/MD5');
         $package_sha256 = $xml_parser->getXMLArrayValues('PhoronixTestSuite/Downloads/Package/SHA256');
         $package_filename = $xml_parser->getXMLArrayValues('PhoronixTestSuite/Downloads/Package/FileName');
         $package_filesize = $xml_parser->getXMLArrayValues('PhoronixTestSuite/Downloads/Package/FileSize');
         $package_platform = $xml_parser->getXMLArrayValues('PhoronixTestSuite/Downloads/Package/PlatformSpecific');
         $package_architecture = $xml_parser->getXMLArrayValues('PhoronixTestSuite/Downloads/Package/ArchitectureSpecific');
         foreach (array_keys($package_url) as $i) {
             if (!empty($package_platform[$i]) && $do_file_checks) {
                 $platforms = pts_strings::comma_explode($package_platform[$i]);
                 if (!in_array(phodevi::operating_system(), $platforms) && !(phodevi::is_bsd() && in_array('Linux', $platforms) && (pts_client::executable_in_path('kldstat') && strpos(shell_exec('kldstat -n linux 2>&1'), 'linux.ko') != false))) {
                     // This download does not match the operating system
                     continue;
                 }
             }
             if (!empty($package_architecture[$i]) && $do_file_checks) {
                 $architectures = pts_strings::comma_explode($package_architecture[$i]);
                 if (phodevi::cpu_arch_compatible($architectures) == false) {
                     // This download does not match the CPU architecture
                     continue;
                 }
             }
             $this->test_files[] = new pts_test_file_download($package_url[$i], $package_filename[$i], $package_filesize[$i], $package_md5[$i], $package_sha256[$i], $package_platform[$i], $package_architecture[$i]);
         }
     }
 }
开发者ID:pacificIT,项目名称:phoronix-test-suite,代码行数:31,代码来源:pts_test_install_request.php

示例2: run

 public static function run($r)
 {
     pts_client::$display->generic_heading('Available Tests');
     $test_count = 0;
     foreach (pts_openbenchmarking::available_tests(false) as $identifier) {
         $repo = substr($identifier, 0, strpos($identifier, '/'));
         $id = substr($identifier, strlen($repo) + 1);
         $repo_index = pts_openbenchmarking::read_repository_index($repo);
         if (!in_array(phodevi::operating_system(), $repo_index['tests'][$id]['supported_platforms']) || empty($repo_index['tests'][$id]['title'])) {
             // Don't show unsupported tests
             continue;
         }
         echo sprintf('%-30ls - %-35ls %-9ls', $identifier, $repo_index['tests'][$id]['title'], $repo_index['tests'][$id]['test_type']) . PHP_EOL;
         $test_count++;
     }
     foreach (pts_file_io::glob(PTS_TEST_PROFILE_PATH . 'local/*/test-definition.xml') as $path) {
         $test_profile = new pts_test_profile('local/' . basename(dirname($path)));
         if ($test_profile->get_title() != null && $test_profile->is_supported(false)) {
             echo sprintf('%-30ls - %-35ls %-9ls', $test_profile->get_identifier(), $test_profile->get_title(), $test_profile->get_test_hardware_type()) . PHP_EOL;
             $test_count++;
         }
     }
     if ($test_count == 0) {
         echo PHP_EOL . 'No tests found. Please check that you have Internet connectivity to download test profile data from OpenBenchmarking.org. The Phoronix Test Suite has documentation on configuring the network setup, proxy settings, and PHP network options. Please contact Phoronix Media if you continuing to experience problems.' . PHP_EOL . PHP_EOL;
     }
 }
开发者ID:ShaolongHu,项目名称:phoronix-test-suite,代码行数:26,代码来源:list_available_tests.php

示例3: environmental_variables

 public static function environmental_variables()
 {
     // The PTS environmental variables passed during the testing process, etc
     static $env_variables = null;
     if ($env_variables == null) {
         $env_variables = array('PTS_VERSION' => PTS_VERSION, 'PTS_CODENAME' => PTS_CODENAME, 'PTS_DIR' => PTS_PATH, 'PHP_BIN' => PHP_BIN, 'NUM_CPU_CORES' => phodevi::read_property('cpu', 'core-count'), 'NUM_CPU_NODES' => phodevi::read_property('cpu', 'node-count'), 'NUM_CPU_JOBS' => phodevi::read_property('cpu', 'core-count') * 2, 'SYS_MEMORY' => phodevi::read_property('memory', 'capacity'), 'VIDEO_MEMORY' => phodevi::read_property('gpu', 'memory-capacity'), 'VIDEO_WIDTH' => pts_arrays::first_element(phodevi::read_property('gpu', 'screen-resolution')), 'VIDEO_HEIGHT' => pts_arrays::last_element(phodevi::read_property('gpu', 'screen-resolution')), 'VIDEO_MONITOR_COUNT' => phodevi::read_property('monitor', 'count'), 'VIDEO_MONITOR_LAYOUT' => phodevi::read_property('monitor', 'layout'), 'VIDEO_MONITOR_SIZES' => phodevi::read_property('monitor', 'modes'), 'OPERATING_SYSTEM' => phodevi::read_property('system', 'vendor-identifier'), 'OS_VERSION' => phodevi::read_property('system', 'os-version'), 'OS_ARCH' => phodevi::read_property('system', 'kernel-architecture'), 'OS_TYPE' => phodevi::operating_system(), 'THIS_RUN_TIME' => PTS_INIT_TIME, 'DEBUG_REAL_HOME' => pts_core::user_home_directory());
         if (!pts_client::executable_in_path('cc') && pts_client::executable_in_path('gcc') && getenv('CC') == false) {
             // This helps some test profiles build correctly if they don't do a cc check internally
             $env_variables['CC'] = 'gcc';
         }
     }
     return $env_variables;
 }
开发者ID:Grdflo,项目名称:phoronix-test-suite,代码行数:13,代码来源:pts_client.php

示例4: get_contained_test_profiles

 public function get_contained_test_profiles()
 {
     $contained = array();
     // read the repo
     $repo_index = pts_openbenchmarking::read_repository_index($this->repo);
     if (isset($repo_index['tests']) && is_array($repo_index['tests'])) {
         foreach ($repo_index['tests'] as $test_identifier => &$test) {
             if (!in_array(phodevi::operating_system(), $test['supported_platforms']) || empty($test['title'])) {
                 // Initial check to not do unsupported tests
                 continue;
             }
             if ($this->is_virtual_os_selector && !in_array($this->virtual, array_map('strtolower', $test['supported_platforms']))) {
                 // Doing a virtual suite of all tests specific to an OS, but this test profile is not supported there
                 continue;
             } else {
                 if ($this->is_virtual_subsystem_selector && $this->virtual != strtolower($test['test_type'])) {
                     // Doing a virtual suite of all tests specific to a test_type, but this test profile is not supported there
                     continue;
                 } else {
                     if ($this->is_virtual_software_type && $this->virtual != strtolower($test['software_type'])) {
                         // Doing a virtual suite of all tests specific to a software_type, but this test profile is not supported there
                         continue;
                     } else {
                         if ($this->is_virtual_internal_tag && !in_array($this->virtual, array_map('strtolower', $test['internal_tags']))) {
                             // Doing a virtual suite of all tests matching an internal tag
                             continue;
                         }
                     }
                 }
             }
             $test_version = array_shift($test['versions']);
             $test_profile = new pts_test_profile($this->repo . '/' . $test_identifier . '-' . $test_version);
             if ($test_profile->get_display_format() != 'BAR_GRAPH' || !in_array($test_profile->get_license(), array('Free', 'Non-Free'))) {
                 // Also ignore these tests
                 continue;
             }
             if ($this->is_virtual_installed && $test_profile->is_test_installed() == false) {
                 // Test is not installed
                 continue;
             }
             if ($test_profile->is_supported(false)) {
                 // All checks passed, add to virtual suite
                 array_push($contained, $test_profile);
                 continue;
             }
         }
     }
     return $contained;
 }
开发者ID:ShaolongHu,项目名称:phoronix-test-suite,代码行数:49,代码来源:pts_virtual_test_suite.php

示例5: get_file_installer

 public function get_file_installer()
 {
     $test_resources_location = $this->get_resource_dir();
     $os_postfix = '_' . strtolower(phodevi::operating_system());
     if (is_file($test_resources_location . 'install' . $os_postfix . '.sh')) {
         $installer = $test_resources_location . 'install' . $os_postfix . '.sh';
     } else {
         if (is_file($test_resources_location . 'install.sh')) {
             $installer = $test_resources_location . 'install.sh';
         } else {
             $installer = null;
         }
     }
     return $installer;
 }
开发者ID:pacificIT,项目名称:phoronix-test-suite,代码行数:15,代码来源:pts_test_profile.php

示例6: call_test_script

 public static function call_test_script($test_profile, $script_name, $print_string = null, $pass_argument = null, $extra_vars_append = null, $use_ctp = true)
 {
     $extra_vars = pts_tests::extra_environmental_variables($test_profile);
     if (isset($extra_vars_append['PATH'])) {
         // Special case variable where you likely want the two merged rather than overwriting
         $extra_vars['PATH'] = $extra_vars_append['PATH'] . (substr($extra_vars_append['PATH'], -1) != ':' ? ':' : null) . $extra_vars['PATH'];
         unset($extra_vars_append['PATH']);
     }
     if (is_array($extra_vars_append)) {
         $extra_vars = array_merge($extra_vars, $extra_vars_append);
     }
     // TODO: call_test_script could be better cleaned up to fit more closely with new pts_test_profile functions
     $result = null;
     $test_directory = $test_profile->get_install_dir();
     pts_file_io::mkdir($test_directory, 0777, true);
     $os_postfix = '_' . strtolower(phodevi::operating_system());
     $test_profiles = array($test_profile);
     if ($use_ctp) {
         $test_profiles = array_merge($test_profiles, $test_profile->extended_test_profiles());
     }
     if (pts_client::executable_in_path('bash')) {
         $sh = 'bash';
     } else {
         $sh = 'sh';
     }
     foreach ($test_profiles as &$this_test_profile) {
         $test_resources_location = $this_test_profile->get_resource_dir();
         if (is_file($run_file = $test_resources_location . $script_name . $os_postfix . '.sh') || is_file($run_file = $test_resources_location . $script_name . '.sh')) {
             if (!empty($print_string)) {
                 pts_client::$display->test_run_message($print_string);
             }
             if (phodevi::is_windows() || pts_client::read_env('USE_PHOROSCRIPT_INTERPRETER') != false) {
                 $phoroscript = new pts_phoroscript_interpreter($run_file, $extra_vars, $test_directory);
                 $phoroscript->execute_script($pass_argument);
                 $this_result = null;
             } else {
                 $this_result = pts_client::shell_exec('cd ' . $test_directory . ' && ' . $sh . ' ' . $run_file . ' "' . $pass_argument . '" 2>&1', $extra_vars);
             }
             if (trim($this_result) != null) {
                 $result = $this_result;
             }
         }
     }
     return $result;
 }
开发者ID:ptzafrir,项目名称:phoronix-test-suite,代码行数:45,代码来源:pts_tests.php

示例7: initial_setup

 public static function initial_setup()
 {
     // Operating System Detection
     $supported_operating_systems = pts_types::operating_systems();
     $uname_s = strtolower(php_uname('s'));
     foreach ($supported_operating_systems as $os_check) {
         for ($i = 0; $i < count($os_check); $i++) {
             if (strpos($uname_s, strtolower($os_check[$i])) !== false) {
                 self::$operating_system = $os_check[0];
                 self::$operating_systems[strtolower($os_check[0])] = true;
                 break;
             }
         }
         if (self::$operating_system != null) {
             break;
         }
     }
     if (self::operating_system() == false) {
         self::$operating_system = 'Unknown';
     }
     self::load_sensors();
 }
开发者ID:QueenGirl,项目名称:phoronix-test-suite,代码行数:22,代码来源:phodevi.php

示例8: initial_setup

 public static function initial_setup()
 {
     // Operating System Detection
     $supported_operating_systems = pts_types::operating_systems();
     $uname_s = strtolower(php_uname('s'));
     foreach ($supported_operating_systems as $os_check) {
         for ($i = 0; $i < count($os_check); $i++) {
             if (strpos($uname_s, strtolower($os_check[$i])) !== false) {
                 self::$operating_system = $os_check[0];
                 self::$operating_systems[strtolower($os_check[0])] = true;
                 break;
             }
         }
         if (self::$operating_system != null) {
             break;
         }
     }
     if (self::operating_system() == false) {
         self::$operating_system = 'Unknown';
     }
     // OpenGL / graphics detection
     $graphics_detection = array('NVIDIA', array('ATI', 'AMD', 'fglrx'), array('Mesa', 'SGI'));
     $opengl_driver = phodevi::read_property('system', 'opengl-vendor') . ' ' . phodevi::read_property('system', 'opengl-driver') . ' ' . phodevi::read_property('system', 'dri-display-driver');
     $opengl_driver = trim(str_replace('Corporation', null, $opengl_driver));
     // Prevents a possible false positive for ATI being in CorporATIon
     foreach ($graphics_detection as $gpu_check) {
         if (!is_array($gpu_check)) {
             $gpu_check = array($gpu_check);
         }
         for ($i = 0; $i < count($gpu_check); $i++) {
             if (stripos($opengl_driver, $gpu_check[$i]) !== false) {
                 self::$graphics[strtolower($gpu_check[0])] = true;
                 break;
             }
         }
     }
     self::load_sensors();
 }
开发者ID:ptzafrir,项目名称:phoronix-test-suite,代码行数:38,代码来源:phodevi.php


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