ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
release1-update.php
Go to the documentation of this file.
1<?php
2
3// release script
4// PHP 5.0 only
5
6if (php_sapi_name() != 'cli') {
7 echo 'Release script cannot be called from web-browser.';
8 exit;
9}
10
11if (!isset($argv[1])) {
12 echo
13'php release.php [version]
14 HTML Purifier release script
15';
16 exit;
17}
18
19$version = trim($argv[1]);
20
21// Bump version numbers:
22
23// ...in VERSION
24file_put_contents('VERSION', $version);
25
26// ...in NEWS
27if ($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'),
33 $c
34 );
35 if (!$c) {
36 echo 'Could not update NEWS, missing ' . $l . PHP_EOL;
37 exit;
38 } elseif ($c > 1) {
39 echo 'More than one release declaration in NEWS replaced' . PHP_EOL;
40 exit;
41 }
42 file_put_contents('NEWS', $news_c);
43}
44
45// ...in Doxyfile
46$doxyfile_c = preg_replace(
47 '/(?<=PROJECT_NUMBER {9}= )[^\s]+/m', // brittle
49 file_get_contents('Doxyfile'),
50 1, $c
51);
52if (!$c) {
53 echo 'Could not update Doxyfile, missing PROJECT_NUMBER.' . PHP_EOL;
54 exit;
55}
56file_put_contents('Doxyfile', $doxyfile_c);
57
58// ...in HTMLPurifier.php
59$htmlpurifier_c = file_get_contents('library/HTMLPurifier.php');
60$htmlpurifier_c = preg_replace(
61 '/HTML Purifier .+? - /',
62 "HTML Purifier $version - ",
64 1, $c
65);
66if (!$c) {
67 echo 'Could not update HTMLPurifier.php, missing HTML Purifier [version] header.' . PHP_EOL;
68 exit;
69}
70$htmlpurifier_c = preg_replace(
71 '/public \$version = \'.+?\';/',
72 "public \$version = '$version';",
74 1, $c
75);
76if (!$c) {
77 echo 'Could not update HTMLPurifier.php, missing public $version.' . PHP_EOL;
78 exit;
79}
80$htmlpurifier_c = preg_replace(
81 '/const VERSION = \'.+?\';/',
82 "const VERSION = '$version';",
84 1, $c
85);
86if (!$c) {
87 echo 'Could not update HTMLPurifier.php, missing const $version.' . PHP_EOL;
88 exit;
89}
90file_put_contents('library/HTMLPurifier.php', $htmlpurifier_c);
91
92$config_c = file_get_contents('library/HTMLPurifier/Config.php');
93$config_c = preg_replace(
94 '/public \$version = \'.+?\';/',
95 "public \$version = '$version';",
97 1, $c
98);
99if (!$c) {
100 echo 'Could not update Config.php, missing public $version.' . PHP_EOL;
101 exit;
102}
103file_put_contents('library/HTMLPurifier/Config.php', $config_c);
104
105passthru('php maintenance/flush.php');
106
107if ($is_dev) echo "Review changes, write something in WHATSNEW and FOCUS, and then commit with log 'Release $version.'" . PHP_EOL;
108else echo "Numbers updated to dev, no other modifications necessary!";
109
110// vim: et sw=4 sts=4
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
global $l
Definition: afr.php:30
An exception for terminatinating execution or to throw for unit testing.
$config_c
if(php_sapi_name() !='cli') if(!isset($argv[1])) $version
$htmlpurifier_c
if($is_dev=(strpos($version, 'dev')===false)) $doxyfile_c
global $argv
Definition: svg-scanner.php:41