Example #1
0
        return $cache;
    }
    foreach (scandir('sources') as $dir) {
        if ($dir !== '.' && $dir !== '..' && $dir !== 'php-src' && $dir !== 'pecl' && substr_compare($dir, 'PHP_', 0, 4, true) !== 0) {
            $releases[] = $dir;
        }
    }
    natsort($releases);
    return $cache = $releases;
}
// if run alone, it means debug mode and thus no slow network access
if (basename(__FILE__) == $_SERVER['PHP_SELF']) {
    $skip_download = true;
}
// fetch all version tags
$tags = get_php_release_tags();
// PHP 4.0.7 wasn't released, although it was tagged in CVS
$key = array_search('PHP_4_0_7', $tags);
if ($key !== false) {
    unset($tags[$key]);
}
$lasttag = 'PHP_4_0_0';
foreach (array_merge($tags, array('php_head')) as $tag) {
    if ($tag[4] === $lasttag[4]) {
        $lasttag = $tag;
        continue;
    }
    $last_versions[] = substr($lasttag, 4);
    // this is the last released version from a major version
    $lasttag = $tag;
}
Example #2
0
    chdir('..');
    `rm -fr tmp`;
    echo "done\n";
}
/** fetch a tag sources */
function checkout_tag($tag)
{
    // $tag = PHP_x_x_x
    $majorversion = substr($tag, 4, 1);
    $dir = 'php-' . strtr(substr($tag, 4), '_', '.');
    $filename = "{$dir}.tar.gz";
    $url = "http://museum.php.net/php{$majorversion}/{$filename}";
    download_sources($url, $dir, $filename, $tag);
}
chdir('sources');
foreach (get_php_release_tags() as $tag) {
    $tag = strtoupper($tag);
    echo "Getting tag: {$tag}... ";
    checkout_tag($tag);
}
foreach ($cvs_branches as $tag => $branch) {
    echo "Getting tag: {$tag}... ";
    $dir = strtolower($tag);
    // if the dir already exists, perform an update rather than a checkout
    if (is_dir($dir)) {
        `cd {$dir} && cvs -q up -dP -r {$branch}`;
        // zend dirs require special handling because cvs is damn stupid..
        if (is_dir("{$dir}/Zend")) {
            `cd {$dir}/Zend && cvs -q up -dP -r {$branch}`;
        }
        if (is_dir("{$dir}/ZendEngine2")) {