#!/usr/local/bin/php
<?php
PHP_SAPI == 'cli' or die("Please run this script using the cli sapi");

require "include/version.inc";
require "include/releases.inc";

$major = $argv[1];
isset($RELEASES[$major]) or die("Unkown major version $major");

list($k, $v) = each($RELEASES[$major]);

$tmp = 'PHP_' .$major. '_DATE';
$v["date"] = $$tmp;

if (is_bool($v["announcement"]) && $v["announcement"]) {
	$v["announcement"] = array("English" => "/releases/" . str_replace(".", "_", $k) . ".php");
}
$v["museum"] = false;
$a = array_merge(
	array($k => $v),
	$OLDRELEASES[$major]
);
$OLDRELEASES[$major] = $a;

file_put_contents("include/releases.inc", array("<?php\n\$OLDRELEASES = ", var_export($OLDRELEASES, true), ";\n"));

echo "This was fun \o/\nI hope you remembered to run this script *before* updating include/version.inc... :)\n";

