add git source: HIT

pull/493/head
qkqpttgf 2021-12-20 10:42:11 +08:00 committed by GitHub
parent 3504685172
commit 5515b5bc9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 3 deletions

View File

@ -340,10 +340,15 @@ function_name:' . $_SERVER['function_name'] . '<br>
<button onclick="location.href = location.href;">'.getconstStr('Refresh').'</button>';
}
function OnekeyUpate($auth = 'qkqpttgf', $project = 'OneManager-php', $branch = 'master')
function OnekeyUpate($GitSource = 'Github', $auth = 'qkqpttgf', $project = 'OneManager-php', $branch = 'master')
{
//'https://github.com/qkqpttgf/OneManager-php/tarball/master/';
$source = 'https://github.com/' . $auth . '/' . $project . '/tarball/' . urlencode($branch) . '/';
if ($GitSource=='Github') {
//'https://github.com/qkqpttgf/OneManager-php/tarball/master/';
$source = 'https://github.com/' . $auth . '/' . $project . '/tarball/' . urlencode($branch) . '/';
} elseif ($GitSource=='HITGitlab') {
$source = 'https://git.hit.edu.cn/' . $auth . '/' . $project . '/-/archive/' . urlencode($branch) . '/' . $project . '-' . urlencode($branch) . '.tar.gz';
} else return ['stat'=>403, 'body'=>json_encode(['id'=>'Error', 'message'=>'Git Source input Error!'])];
return updateHerokuapp(getConfig('HerokuappId'), getConfig('APIKey'), $source);
}