Commit bb1ab438 authored by dmorley's avatar dmorley

revert back to original file with zot fix

parent 5a902992
......@@ -59,19 +59,18 @@ foreach ($softwares as $software => $details) {
}
} elseif ($details['gittype'] === 'gitlab') {
$context = stream_context_create($opts);
$releasejson = file_get_contents('https://' . $details['gitsite'] . '/api/v4/projects/' . $details['repo'] . '/repository/tags', false, $context);
$release = json_decode($releasejson ?: '', true);
$releasejson = json_decode(file_get_contents('https://' . $details['gitsite'] . '/api/v4/projects/' . $details['repo'] . '/repository/tags', false, $context));
if ($details['devbranch']) {
$commitjson = json_decode(file_get_contents('https://' . $details['gitsite'] . '/api/v4/projects/' . $details['repo'] . '/repository/commits/' . $details['devbranch'], false, $context));
} else {
$commitjson = '';
}
if ($masterversion = $release[0]->name ? str_replace('v', '', $release[0]->name) : '') {
if ($masterversion = $releasejson[0]->name ? str_replace('v', '', $releasejson[0]->name) : '') {
try {
$m = R::dispense('masterversions');
$m['software'] = $software;
$m['version'] = $masterversion;
if ($releasedate = $release[0] ? $release[0]->commit->created_at : '') {
if ($releasedate = $releasejson[0] ? $releasejson[0]->commit->created_at : '') {
$m['releasedate'] = $releasedate;
}
if ($devlastcommit = $commitjson ? $commitjson->created_at : '') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment