1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-08-18 20:02:42 +02:00

[3.1.0] Add const version to HTMLPurifier, also bump version to 3.1.0-dev; this apparently is a good idea!

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1692 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2008-04-25 05:26:10 +00:00
parent 438d973073
commit 6d9643a92e
8 changed files with 41 additions and 26 deletions

View File

@@ -24,21 +24,23 @@ $version = trim($argv[1]);
file_put_contents('VERSION', $version);
// ...in NEWS
$date = date('Y-m-d');
$news_c = str_replace(
$l = "$version, unknown release date",
"$version, released $date",
file_get_contents('NEWS'),
$c
);
if (!$c) {
echo 'Could not update NEWS, missing ' . $l . PHP_EOL;
exit;
} elseif ($c > 1) {
echo 'More than one release declaration in NEWS replaced' . PHP_EOL;
exit;
if ($is_dev = (strpos($version, 'dev') === false)) {
$date = date('Y-m-d');
$news_c = str_replace(
$l = "$version, unknown release date",
"$version, released $date",
file_get_contents('NEWS'),
$c
);
if (!$c) {
echo 'Could not update NEWS, missing ' . $l . PHP_EOL;
exit;
} elseif ($c > 1) {
echo 'More than one release declaration in NEWS replaced' . PHP_EOL;
exit;
}
file_put_contents('NEWS', $news_c);
}
file_put_contents('NEWS', $news_c);
// ...in Doxyfile
$doxyfile_c = preg_replace(
@@ -72,7 +74,17 @@ $htmlpurifier_c = preg_replace(
1, $c
);
if (!$c) {
echo 'Could not update HTMLPurifier.php, missing var $version.' . PHP_EOL;
echo 'Could not update HTMLPurifier.php, missing public $version.' . PHP_EOL;
exit;
}
$htmlpurifier_c = preg_replace(
'/const version = \'.+?\';/',
"const version = '$version';",
$htmlpurifier_c,
1, $c
);
if (!$c) {
echo 'Could not update HTMLPurifier.php, missing const $version.' . PHP_EOL;
exit;
}
file_put_contents('library/HTMLPurifier.php', $htmlpurifier_c);
@@ -85,12 +97,12 @@ $config_c = preg_replace(
1, $c
);
if (!$c) {
echo 'Could not update Config.php, missing var $version.' . PHP_EOL;
echo 'Could not update Config.php, missing public $version.' . PHP_EOL;
exit;
}
file_put_contents('library/HTMLPurifier/Config.php', $config_c);
passthru('php maintenance/flush.php');
echo "Review changes, write something in WHATSNEW, and then SVN commit with log 'Release $version.'" . PHP_EOL;
if ($is_dev) echo "Review changes, write something in WHATSNEW, and then SVN commit with log 'Release $version.'" . PHP_EOL;
else echo "Numbers updated to dev, no other modifications necessary!";