6 if (php_sapi_name() !=
'cli') {
7 echo
'Release script cannot be called from web-browser.';
11 if (!isset(
$argv[1])) {
13 'php release.php [version] 14 HTML Purifier release script 24 file_put_contents(
'VERSION',
$version);
27 if ($is_dev = (strpos(
$version,
'dev') ===
false)) {
28 $date =
date(
'Y-m-d');
29 $news_c = str_replace(
30 $l =
"$version, unknown release date",
31 "$version, released $date",
32 file_get_contents(
'NEWS'),
36 echo
'Could not update NEWS, missing ' .
$l .
PHP_EOL;
39 echo
'More than one release declaration in NEWS replaced' .
PHP_EOL;
42 file_put_contents(
'NEWS', $news_c);
47 '/(?<=PROJECT_NUMBER {9}= )[^\s]+/m',
49 file_get_contents(
'Doxyfile'),
53 echo
'Could not update Doxyfile, missing PROJECT_NUMBER.' .
PHP_EOL;
61 '/HTML Purifier .+? - /',
62 "HTML Purifier $version - ",
67 echo
'Could not update HTMLPurifier.php, missing HTML Purifier [version] header.' .
PHP_EOL;
71 '/public \$version = \'.+?\';/',
72 "public \$version = '$version';",
77 echo
'Could not update HTMLPurifier.php, missing public $version.' .
PHP_EOL;
81 '/const VERSION = \'.+?\';/',
82 "const VERSION = '$version';",
87 echo
'Could not update HTMLPurifier.php, missing const $version.' .
PHP_EOL;
92 $config_c = file_get_contents(
'library/HTMLPurifier/Config.php');
94 '/public \$version = \'.+?\';/',
95 "public \$version = '$version';",
100 echo
'Could not update Config.php, missing public $version.' .
PHP_EOL;
103 file_put_contents(
'library/HTMLPurifier/Config.php',
$config_c);
105 passthru(
'php maintenance/flush.php');
107 if ($is_dev) echo
"Review changes, write something in WHATSNEW and FOCUS, and then commit with log 'Release $version.'" .
PHP_EOL;
108 else echo
"Numbers updated to dev, no other modifications necessary!";
if(php_sapi_name() !='cli') if(!isset($argv[1])) $version
if($is_dev) echo "Review changes write something in WHATSNEW and and then commit with log PHP_EOL
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
if($is_dev=(strpos($version, 'dev')===false)) $doxyfile_c