Пример #1
0
function calc_loader_latest_version()
{
    $lv_info = get_loader_version_info();
    if (empty($lv_info)) {
        return RECENT_LOADER_VERSION;
    } else {
        $platform_info = get_platforminfo();
        $loader = get_loaderinfo();
        if (count($loader['osvariants']) > 1) {
            list($osvar, $exact_match) = get_reqd_version($loader['osvariants']);
        } else {
            $osvar = null;
        }
        $dirname = '';
        foreach ($platform_info as $p) {
            if ($p['os'] == $loader['oscode'] && $p['arch'] == $loader['arch'] && (empty($osvar) || $p['os_mod'] == "_" . $osvar)) {
                $dirname = $p['dirname'];
                break;
            }
        }
        if (!empty($dirname) && array_key_exists($dirname, $lv_info)) {
            return $lv_info[$dirname];
        } else {
            return RECENT_LOADER_VERSION;
        }
    }
}
Пример #2
0
function calc_dirname()
{
    $platform_info = get_platforminfo();
    $loader = get_loaderinfo();
    if (count($loader['osvariants']) > 1) {
        list($osvar,$exact_match) = get_reqd_version($loader['osvariants']);
    } else {
        $osvar = null;
    }
    $dirname = '';
    foreach ($platform_info as $p) {
        if ($p['os'] == $loader['oscode'] && $p['arch'] == $loader['arch'] && (empty($osvar) || $p['os_mod'] == "_" . $osvar)) {
            $dirname = $p['dirname'];
            break;
        }
    }
    return $dirname;
}
Пример #3
0
function calc_dirname()
{
    $platform_info = get_platforminfo();
    $loader = get_loaderinfo();
    $multiple_os_versions = false;
    if (is_array($loader) && array_key_exists('osvariants', $loader) && is_array($loader['osvariants'])) {
        $versions = array_values($loader['osvariants']);
        $multiple_os_versions = !empty($versions[0]);
    }
    if ($multiple_os_versions) {
        list($osvar, $exact_match) = get_reqd_version($loader['osvariants']);
    } else {
        $osvar = null;
    }
    $dirname = '';
    foreach ($platform_info as $p) {
        if ($p['os'] == $loader['oscode'] && $p['arch'] == $loader['arch'] && (empty($osvar) || $p['os_mod'] == "_" . $osvar)) {
            $dirname = $p['dirname'];
            break;
        }
    }
    return $dirname;
}
Пример #4
0
function calc_platform()
{
    $platform = array();
    $platform_info = get_platforminfo();
    $loader = get_loaderinfo();
    $multiple_os_versions = false;
    if (is_array($loader) && array_key_exists('osvariants', $loader) && is_array($loader['osvariants'])) {
        $versions = array_values($loader['osvariants']);
        $multiple_os_versions = !empty($versions[0]);
    }
    if ($multiple_os_versions) {
        list($osvar, $exact_match) = get_reqd_version($loader['osvariants']);
    } else {
        $osvar = null;
        if (is_ms_windows()) {
            $sys = get_sysinfo();
            $phpc = empty($sys['PHP_COMPILER']) ? 'vc6' : strtolower($sys['PHP_COMPILER']);
            $osvar = ($sys['THREAD_SAFE'] ? '' : 'nonts_') . $phpc;
        }
    }
    foreach ($platform_info as $p) {
        if ($p['os'] == $loader['oscode'] && $p['arch'] == $loader['arch'] && (empty($osvar) || $p['os_mod'] == "_" . $osvar)) {
            $platform = $p;
            break;
        }
    }
    return $platform;
}