Skip to content

Commit

Permalink
Merge pull request #9 from OGSteam/API-Request-Info
Browse files Browse the repository at this point in the history
Api request info
  • Loading branch information
darknoon29 committed Mar 5, 2017
2 parents 7634c6f + 91b8e74 commit 035628b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 13 additions & 1 deletion core/mod_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ function getRepositoryVersion($Reponame, $isMod = true)
$api_list = file_get_contents('./mod/autoupdate/tmp/' . $Reponame . '.json');

$data = json_decode($api_list, true);
asort($data);

if (count($data) > 0) {
return $data[0]['name'];
Expand All @@ -122,6 +123,7 @@ function getRepositoryVersion($Reponame, $isMod = true)

/**
* @param string $request
* @return string
*/
function github_Request($request) {

Expand All @@ -135,7 +137,17 @@ function github_Request($request) {
];

$context = stream_context_create($opts);
$data = file_get_contents($request, false, $context);

try {
$data = file_get_contents($request, false, $context);

if ($data === false) {
log_('mod', "[ERROR_github_Request] Unable to get: " . $request);
}
} catch (Exception $e) {
log_('mod', "[ERROR_github_Request] Excetpion: " . $e->getMessage() );
}

return $data;
}

2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
autoupdate
3.0.0
3.0.1
autoupdate,AutoUpdate,autoupdate,autoupdate,autoupdate.php,1,1
3.3.2

0 comments on commit 035628b

Please sign in to comment.