-
Notifications
You must be signed in to change notification settings - Fork 85
/
manifest_updater.php
45 lines (28 loc) · 942 Bytes
/
manifest_updater.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
/**
* Simple script to update manifest version / date.
*
* NOTE: THIS IS NO LONGER USED SINCE WE MOVED TO ANT TO BUILD
*/
$INPUT_FILE = "manifest.template.php";
$OUTPUT_FILE = "manifest.php";
$warning = "// DO NOT MODIFY THIS FILE... THIS FILE IS AUTOGENERATED FROM $INPUT_FILE during build_zip.sh script!";
$warning = "$warning\n$warning\n$warning\n$warning\n$warning\n$warning\n";
$manifest = file_get_contents( $INPUT_FILE );
if( empty($manifest) ) {
print "NO MANIFEST";
die("Unable to read the input manifest file!");
}
//print $manifest;
$manifestOutput = '';
if( $argc > 1 ) {
$manifestOutput = str_replace( array("@@VERSION@@", "@@PUBLISH_DATE@@","@@WARNING@@"),
array($argv[1], date("Y-M-d H:m"), $warning),
$manifest
);
}
else {
print "ERROR: no version argument provided.";
}
print $manifestOutput;
file_put_contents( $OUTPUT_FILE, $manifestOutput);