本文整理汇总了PHP中phodevi::is_hurd方法的典型用法代码示例。如果您正苦于以下问题:PHP phodevi::is_hurd方法的具体用法?PHP phodevi::is_hurd怎么用?PHP phodevi::is_hurd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类phodevi
的用法示例。
在下文中一共展示了phodevi::is_hurd方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sw_operating_system
public static function sw_operating_system()
{
if (!PTS_IS_CLIENT) {
// TODO: Figure out why this function is sometimes called from OpenBenchmarking.org....
return false;
}
// Determine the operating system release
if (phodevi::is_linux()) {
$vendor = phodevi_linux_parser::read_lsb_distributor_id();
if ($vendor == null) {
if (is_readable('/etc/os-release')) {
$os_release = parse_ini_file('/etc/os-release');
} else {
if (is_readable('/usr/lib/os-release')) {
$os_release = parse_ini_file('/usr/lib/os-release');
} else {
$os_release = null;
}
}
if (isset($os_release['PRETTY_NAME']) && !empty($os_release['PRETTY_NAME'])) {
$vendor = $os_release['PRETTY_NAME'];
} else {
if (isset($os_release['NAME']) && !empty($os_release['NAME'])) {
$vendor = $os_release['NAME'];
}
}
}
} else {
if (phodevi::is_hurd()) {
$vendor = php_uname('v');
} else {
$vendor = null;
}
}
$version = phodevi::read_property('system', 'os-version');
if (!$vendor) {
$os = null;
// Try to detect distro for those not supplying lsb_release
$files = pts_file_io::glob('/etc/*-version');
for ($i = 0; $i < count($files) && $os == null; $i++) {
$file = file_get_contents($files[$i]);
if (trim($file) != null) {
$os = substr($file, 0, strpos($file, "\n"));
}
}
if ($os == null) {
$files = pts_file_io::glob('/etc/*-release');
for ($i = 0; $i < count($files) && $os == null; $i++) {
$file = file_get_contents($files[$i]);
if (trim($file) != null) {
$proposed_os = substr($file, 0, strpos($file, PHP_EOL));
if (strpos($proposed_os, '=') == false) {
$os = $proposed_os;
}
} else {
if ($i == count($files) - 1) {
$os = ucwords(substr($n = basename($files[$i]), 0, strpos($n, '-')));
}
}
}
}
if ($os == null && is_file('/etc/release')) {
$file = file_get_contents('/etc/release');
$os = substr($file, 0, strpos($file, "\n"));
}
if ($os == null && is_file('/etc/palm-build-info')) {
// Palm / webOS Support
$os = phodevi_parser::parse_equal_delimited_file('/etc/palm-build-info', 'PRODUCT_VERSION_STRING');
}
if ($os == null) {
if (phodevi::is_windows()) {
$os = trim(exec('ver'));
}
if (is_file('/etc/debian_version')) {
$os = 'Debian ' . php_uname('s') . ' ' . ucwords(pts_file_io::file_get_contents('/etc/debian_version'));
} else {
$os = php_uname('s');
}
} else {
if (strpos($os, ' ') === false) {
// The OS string is only one word, likely a problem...
if (is_file('/etc/arch-release') && stripos($os, 'Arch') === false) {
// On at least some Arch installs (ARM) the file is empty so would have missed above check
$os = trim('Arch Linux ' . $os);
}
}
}
} else {
if (stripos($vendor, $version) === false) {
$os = $vendor . ' ' . $version;
} else {
$os = $vendor;
}
}
if (($break_point = strpos($os, ':')) > 0) {
$os = substr($os, $break_point + 1);
}
if (phodevi::is_macosx()) {
$os = phodevi_osx_parser::read_osx_system_profiler('SPSoftwareDataType', 'SystemVersion');
}
//.........这里部分代码省略.........
示例2: is_test_platform_supported
public function is_test_platform_supported()
{
// Check if the system's OS is supported by a test
$supported = true;
$platforms = $this->get_supported_platforms();
if (!empty($platforms) && !in_array(phodevi::operating_system(), $platforms)) {
if (phodevi::is_bsd() && in_array('Linux', $platforms) && (pts_client::executable_in_path('kldstat') && strpos(shell_exec('kldstat -n linux 2>&1'), 'linux.ko') != false)) {
// The OS is BSD but there is Linux API/ABI compatibility support loaded
$supported = true;
} else {
if (phodevi::is_hurd() && in_array('Linux', $platforms) && in_array('BSD', $platforms)) {
// For now until test profiles explicity express Hurd support, just list as supported the tests that work on both BSD and Linux
// TODO: fill in Hurd support for test profiles / see what works
$supported = true;
} else {
$supported = false;
}
}
}
return $supported;
}
示例3: chipset_string
public static function chipset_string()
{
$info = false;
if (phodevi::is_macosx()) {
$sb_vendor = phodevi_osx_parser::read_osx_system_profiler('SPSerialATADataType', 'Vendor');
$sb_product = phodevi_osx_parser::read_osx_system_profiler('SPSerialATADataType', 'Product');
if ($sb_product == 'SSD') {
$sb_product = null;
}
if (($cut_point = strpos($sb_product, ' ')) > 0) {
$sb_product = substr($sb_product, 0, $cut_point);
}
// TODO: Can't find Northbridge
$info = $sb_vendor . ' ' . $sb_product;
} else {
if (phodevi::is_windows()) {
$info = phodevi_windows_parser::read_cpuz('Northbridge', null);
if ($info != null) {
if (($e = strpos($info, 'rev')) !== false) {
$info = substr($info, 0, $e);
}
$info = trim($info);
}
} else {
if (phodevi::is_solaris()) {
// Vendor Detection
$vendor_possible_udis = array('/org/freedesktop/Hal/devices/pci_0_0/pci_ide_3_2_0', '/org/freedesktop/Hal/devices/pci_0_0/pci_ide_1f_1_1');
$info = phodevi_solaris_parser::read_hal_property($vendor_possible_udis, 'info.vendor');
// TODO: Northbridge and Southbridge Detection For Solaris
} else {
if (phodevi::is_linux() || phodevi::is_hurd()) {
$info = phodevi_linux_parser::read_pci(array('RAM memory', 'Host bridge'));
if (count(explode(' ', $info)) == 1) {
$bridge = phodevi_linux_parser::read_pci(array('Bridge', 'PCI bridge'));
if (!empty($bridge)) {
$match = false;
$break_words = array('Ethernet', 'PCI', 'High', 'USB');
for ($i = 0; $i < count($break_words) && !$match; $i++) {
if (($pos = strpos($bridge, $break_words[$i])) > 0) {
$bridge = trim(substr($bridge, 0, $pos));
$info = $bridge;
$match = true;
}
}
}
}
if (!isset($bridge) || !empty($bridge)) {
// Attempt to detect Southbridge (if applicable)
$southbridge = phodevi_linux_parser::read_pci(array('ISA bridge', 'SATA controller'), false);
$southbridge_clean = null;
if (($start_cut = strpos($southbridge, '(')) > 0 && ($end_cut = strpos($southbridge, ')', $start_cut + 1)) > 0) {
$southbridge_extract = substr($southbridge, $start_cut + 1, $end_cut - $start_cut - 1);
if (strpos($southbridge_extract, 'rev') === false) {
$southbridge_extract = explode(' ', $southbridge_extract);
$southbridge_clean = $southbridge_extract[0];
} else {
if (($s = strpos($southbridge, 'ICH')) > 0) {
$southbridge_extract = substr($southbridge, $s);
$southbridge_clean = substr($southbridge_extract, 0, strpos($southbridge_extract, ' '));
}
}
} else {
if (($start_cut = strpos($southbridge, 'SB')) !== false) {
$southbridge_extract = substr($southbridge, $start_cut);
$southbridge_clean = substr($southbridge_extract, 0, strpos($southbridge_extract, ' '));
}
}
if (!empty($southbridge_clean) && $southbridge_clean != 'SB') {
$info .= ' + ' . $southbridge_clean;
}
}
}
}
}
}
return $info;
}