-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathgetLatestVersions.php
More file actions
61 lines (50 loc) · 1.47 KB
/
getLatestVersions.php
File metadata and controls
61 lines (50 loc) · 1.47 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
require_once 'AWSSDKforPHP/sdk.class.php';
include("config.inc.php");
print getObject('7.3-10.10');
print "\n";
print getObject('7.2-10.10');
print "\n";
print getObject('7.1-10.10');
print "\n";
print getObject('7.0-10.10');
print "\n";
print getObject('5.6-10.10');
print getObject('5.6-10.8');
print "\n";
print getObject('5.5-10.10');
print getObject('5.5-10.8');
print getObject('5.5');
print "\n";
print getObject('5.4-10.10');
print getObject('5.4-10.8');
print getObject('5.4');
print "\n";
print getObject('5.3-10.10');
print getObject('5.3-10.8');
print getObject('5.3');
function getObject($src) {
// Instantiate the class
$s3 = new AmazonS3();
$response = $s3->get_object(
'php-osx.liip.ch',
'install/'.$src.'-frontenddev-latest.dat'
);
if ($response->isOK()) {
preg_match("/([5-9]\.[0-9]+)-(10\.[0-9]+){0,1}-*frontenddev-([0-9\.(alphabetaRC\-dev)]+)-([0-9]{8})-([0-9]+)/",$response->body,$matches);
if ($matches[2] == "") {
$matches[2] = "10.6 /10.7 ";
}
if ($matches[2] == "10.8") {
$matches[2] = "10.8 /10.9 ";
}
if ($matches[2] == "10.10") {
$matches[2] = "10.10-10.13";
}
preg_match("/([0-9]{4})([0-9]{2})([0-9]{2})/",$matches[4],$date);
$text = "PHP " . $matches[3] . " for OS X " . $matches[2] . " uploaded at " . $date[1] ."-" . $date[2] . "-" . $date[3] ."\n";
} else {
print "failed \n";
}
return $text;
}