0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-12-22 08:21:52 +00: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

@ -31,7 +31,7 @@ PROJECT_NAME = HTMLPurifier
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER = 3.1.0
PROJECT_NUMBER = 3.1.0-dev
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.

2
NEWS
View File

@ -9,7 +9,7 @@ NEWS ( CHANGELOG and HISTORY ) HTMLPurifier
. Internal change
==========================
3.1.0, released 2008-04-24
3.1.0, unknown release date
# Unnecessary references to objects (vestiges of PHP4) removed from method
signatures. The following methods do not need references when assigning from
them and will result in E_STRICT errors if you try:

View File

@ -1 +1 @@
3.1.0
3.1.0-dev

View File

@ -2,7 +2,7 @@
<usage>
<directive id="Core.CollectErrors">
<file name="HTMLPurifier.php">
<line>129</line>
<line>132</line>
</file>
<file name="HTMLPurifier/Lexer.php">
<line>85</line>

View File

@ -7,7 +7,7 @@
* primary concern and you are using an opcode cache. PLEASE DO NOT EDIT THIS
* FILE, changes will be overwritten the next time the script is run.
*
* @version 3.1.0
* @version 3.1.0-dev
*
* @warning
* You must *not* include any other HTML Purifier files before this file,

View File

@ -19,7 +19,7 @@
*/
/*
HTML Purifier 3.1.0 - Standards Compliant HTML Filtering
HTML Purifier 3.1.0-dev - Standards Compliant HTML Filtering
Copyright (C) 2006-2008 Edward Z. Yang
This library is free software; you can redistribute it and/or
@ -55,7 +55,10 @@ class HTMLPurifier
{
/** Version of HTML Purifier */
public $version = '3.1.0';
public $version = '3.1.0-dev';
/** Constant with version of HTML Purifier */
const version = '3.1.0-dev';
/** Global configuration object */
public $config;

View File

@ -20,7 +20,7 @@ class HTMLPurifier_Config
/**
* HTML Purifier's version
*/
public $version = '3.1.0';
public $version = '3.1.0-dev';
/**
* Bool indicator whether or not to automatically finalize

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!";