function os_arch_string_check($loader_str) { $errors = array(); if (preg_match("/target os:\\s*(([^_]+)_([^-]*)-([[:graph:]]*))/i", $loader_str, $os_matches)) { $loader_info = get_loaderinfo(); $dirname = calc_dirname(); $packed_osname = preg_replace('/\\s/', '', strtolower($loader_info['osname'])); if (strtolower($dirname) != $os_matches[1] && $packed_osname != $os_matches[2]) { $errors[ERROR_LOADER_WRONG_OS] = "您服务器操作系统" . $loader_info['osname'] . "安装了错误的loader。"; } else { $loader_wordsize = strpos($os_matches[3], '64') === false ? 32 : 64; if ($loader_info['arch'] != ($ap = required_loader_arch($os_matches[3], $loader_info['oscode'], $loader_wordsize))) { $err_str = "您服务器上安装了错误的loader。"; $err_str .= " 您得系统是 " . $loader_info['arch']; $err_str .= " 但是该loader是用于 " . $ap . "."; $errors[ERROR_LOADER_WRONG_ARCH] = $err_str; } } } return $errors; }
function os_arch_string_check($loader_str) { $errors = array(); if (preg_match("/target os:\\s*(([^_]+)_([^-]*)-([[:graph:]]*))/i", $loader_str, $os_matches)) { $loader_info = get_loaderinfo(); $dirname = calc_dirname(); $packed_osname = preg_replace('/\\s/', '', strtolower($loader_info['osname'])); if (strtolower($dirname) != $os_matches[1] && $packed_osname != $os_matches[2]) { $errors[ERROR_LOADER_WRONG_OS] = "You have the wrong loader for your operating system, " . $loader_info['osname'] . "."; } else { $loader_wordsize = strpos($os_matches[3], '64') === false ? 32 : 64; if ($loader_info['arch'] != ($ap = required_loader_arch($os_matches[3], $loader_info['oscode'], $loader_wordsize))) { $err_str = "You have the wrong loader for your machine architecture."; $err_str .= " Your system is " . $loader_info['arch']; $err_str .= " but the loader you are using is for " . $ap . "."; $errors[ERROR_LOADER_WRONG_ARCH] = $err_str; } } } return $errors; }
function os_arch_string_check($loader_str) { $errors = array(); if (preg_match("/target os:\s*(([^_]+)_(.*)-\S*)/i",$loader_str,$os_matches)) { $loader_info = get_loaderinfo(); $dirname = calc_dirname(); if (strtolower($dirname) != $os_matches[1] && strtolower($loader_info['osname']) != $os_matches[2]) { $errors[ERROR_LOADER_WRONG_OS] = "You have the wrong loader for your operating system, ". $loader_info['osname'] . "."; } elseif ($loader_info['arch'] != ($ap = required_loader_arch($os_matches[3],$loader_info['oscode'],$loader_info['wordsize']))) { $err_str = "You have the wrong loaders for your machine architecture."; $err_str .= " Your system is " . $loader_info['arch']; $err_str .= " but the loader you are using is for " . $ap . "."; $errors[ERROR_LOADER_WRONG_ARCH] = $err_str; } } return $errors; }