1 |
<?php |
2 |
$prog=array_shift($_SERVER['argv']); |
3 |
if ($_SERVER['argc']<2) die ("usage : " . $prog . " path_to_package.xml [ --debug ]\n"); |
4 |
$file=array_shift($_SERVER['argv']); |
5 |
|
6 |
($xml=simplexml_load_file($file)) || die ($file . " not found !\n"); |
7 |
if (in_array("--debug", $_SERVER['argv'])) print_r($xml); |
8 |
|
9 |
if ($xml['version'] >= "2"){ // Package.xml V 2.0 |
10 |
printf("* Version %s (%s) - API %s (%s) - %s\n\n%s\n\n", |
11 |
$xml->version->release, $xml->stability->release, |
12 |
$xml->version->api, $xml->stability->api, |
13 |
$xml->date, $xml->notes); |
14 |
|
15 |
if (is_array($xml->changelog->release)) foreach($xml->changelog->release as $rel) |
16 |
printf("* Version %s (%s) - API %s (%s) - %s\n\n%s\n\n", |
17 |
$rel->version->release, $rel->stability->release, |
18 |
$rel->version->api, $rel->stability->api, |
19 |
$rel->date, $rel->notes); |
20 |
} else { // Package.xml V 1.0 |
21 |
printf("* Version %s (%s) - %s\n\n%s\n\n", |
22 |
$xml->release->version, $xml->release->state, $xml->release->date, $xml->release->notes); |
23 |
|
24 |
foreach($xml->changelog->release as $rel) |
25 |
printf("* Version %s (%s) - %s\n\n%s\n\n", |
26 |
$rel->version, $rel->state, $rel->date, $rel->notes); |
27 |
} |
28 |
?> |