Esempio n. 1
0
function buildVersions()
{
    $dev_versions = json_decode(file_get_contents('http://qa.php.net/api.php?type=qa-releases&format=json&only=dev_versions'));
    $versions = array();
    // FIXME: manually adding the 5.3 branch as we don't have active qa release for it currently
    $versions = array('5' => array('3' => array()));
    $date = date('Y-m-d');
    $default_versions = array("Git-{$date} (snap)", "Git-{$date} (Git)");
    foreach ($dev_versions as $dev_version) {
        $dev_version_parts = parseVersion($dev_version);
        // if it is a dev version, then add that branch, add the minor-1 version, if it's appropriate
        if ($dev_version_parts['type'] == 'dev') {
            if (!isset($versions[$dev_version_parts['major']][$dev_version_parts['minor']])) {
                $versions[$dev_version_parts['major']][$dev_version_parts['minor']] = array();
            }
        } else {
            $versions[$dev_version_parts['major']][$dev_version_parts['minor']][$dev_version_parts['micro']] = $dev_version_parts;
            ksort($versions[$dev_version_parts['major']][$dev_version_parts['minor']]);
        }
    }
    // add the latest stable for the active branches
    foreach ($versions as $major_number => $major) {
        $stable_releases = unserialize(file_get_contents('http://www.php.net/releases/index.php?serialize=1&max=20&version=' . $major_number));
        foreach ($major as $minor_number => $minor) {
            foreach ($stable_releases as $stable_release_number => $stable_release) {
                if (strpos($stable_release_number, $major_number . '.' . $minor_number) === 0) {
                    $dev_version_parts = parseVersion($stable_release_number);
                    $versions[$dev_version_parts['major']][$dev_version_parts['minor']][$dev_version_parts['micro']] = $dev_version_parts;
                    ksort($versions[$dev_version_parts['major']][$dev_version_parts['minor']]);
                    break;
                }
            }
        }
    }
    $flat_versions = array();
    // add master to the end of the list
    foreach ($default_versions as $default_version) {
        $flat_versions[] = 'master-' . $default_version;
    }
    // add the fetched versions to the list
    foreach ($versions as $major_number => $major) {
        foreach ($major as $minor_number => $minor) {
            // add the default versions to ever minor branch
            foreach ($default_versions as $default_version) {
                $flat_versions[] = $major_number . '.' . $minor_number . $default_version;
            }
            foreach ($minor as $micro_number => $micro) {
                $flat_versions[] = $micro['original_version'];
            }
        }
    }
    // reverse the order, this makes it descending
    $flat_versions = array_reverse($flat_versions);
    return $flat_versions;
}
Esempio n. 2
0
function buildVersions()
{
    $dev_versions = json_decode(file_get_contents('http://qa.php.net/api.php?type=qa-releases&format=json&only=dev_versions'));
    $versions = array();
    $date = date('Y-m-d');
    $default_versions = array("Git-{$date} (snap)", "Git-{$date} (Git)");
    foreach ($dev_versions as $dev_version) {
        $dev_version_parts = parseVersion($dev_version);
        // if it is a dev version, then add that branch, add the minor-1 version, if it's appropriate
        if ($dev_version_parts['type'] == 'dev') {
            if (!isset($versions[$dev_version_parts['major']][$dev_version_parts['minor']])) {
                $versions[$dev_version_parts['major']][$dev_version_parts['minor']] = array();
            }
        } else {
            $versions[$dev_version_parts['major']][$dev_version_parts['minor']][$dev_version_parts['micro']] = $dev_version_parts;
            ksort($versions[$dev_version_parts['major']][$dev_version_parts['minor']]);
        }
    }
    $stable_releases = json_decode(file_get_contents('http://us3.php.net/releases/active.php'), true);
    foreach ($stable_releases as $major => $major_releases) {
        foreach ($major_releases as $release) {
            $version_parts = parseVersion($release['version']);
            $versions[$version_parts['major']][$version_parts['minor']][$version_parts['micro']] = $version_parts;
            ksort($versions[$version_parts['major']][$version_parts['minor']]);
        }
    }
    $flat_versions = array();
    // add master to the end of the list
    foreach ($default_versions as $default_version) {
        $flat_versions[] = 'master-' . $default_version;
    }
    // add the fetched versions to the list
    foreach ($versions as $major_number => $major) {
        foreach ($major as $minor_number => $minor) {
            // add the default versions to ever minor branch
            foreach ($default_versions as $default_version) {
                $flat_versions[] = $major_number . '.' . $minor_number . $default_version;
            }
            foreach ($minor as $micro_number => $micro) {
                $flat_versions[] = $micro['original_version'];
            }
        }
    }
    // reverse the order, this makes it descending
    $flat_versions = array_reverse($flat_versions);
    return $flat_versions;
}
Esempio n. 3
0
        foreach ($meta as $key => $value) {
            print "<tr><th>{$key}</th> <td>{$value}</td></tr>";
        }
    }
    print '</table>';
}
print '</div>';
print '</div>';
//<!--  end wrapper -->
print '<h3>Software Version</h3>';
print '<div>';
if ($PairedEnd) {
    $versiontxt_fwd = parseVersion("fwd_version.txt");
    $versiontxt_rev = parseVersion("rev_version.txt");
}
$versiontxt = parseVersion("version.txt");
$versiontxt_blacklist = array("ion-onetouchupdater" => "", "ion-pgmupdates" => "", "ion-publishers" => "", "ion-referencelibrary" => "", "ion-sampledata" => "", "ion-docs" => "", "ion-tsconfig" => "", "ion-rsmts" => "", "ion-usbmount" => "");
$explogtxt_whitelist = array("Script" => "", "LiveView" => "", "Datacollect" => "", "OS" => "", "Graphics" => "");
if ($versiontxt) {
    // This will get the fist line read from versions.txt
    // which we will bold and use as the header row below.
    list($name, $version) = each($versiontxt);
    unset($versiontxt[$name]);
    $versionstxt = array_diff_key($versiontxt, $versiontxt_blacklist);
    $explog_dict = array_intersect_key($explog_dict, $explogtxt_whitelist);
    if ($explog_dict) {
        $versions = array_merge($versionstxt, $explog_dict);
    } else {
        $versions = $versionstxt;
    }
    // This sorts the software => version list alphabetically.