switches, no ifs
This commit is contained in:
parent
64066592a4
commit
3b15b19e62
1 changed files with 15 additions and 6 deletions
|
@ -21,14 +21,23 @@ function checkversion_run () {
|
||||||
|
|
||||||
$checkurl = Config::get('system', 'check_new_version_url', 'none');
|
$checkurl = Config::get('system', 'check_new_version_url', 'none');
|
||||||
|
|
||||||
// check for new versions at all?
|
switch ($checkurl) {
|
||||||
if ($checkurl == 'none' ) {
|
case 'master':
|
||||||
|
$checked_url = 'https://raw.githubusercontent.com/friendica/friendica/master/VERSION';
|
||||||
|
break;
|
||||||
|
case 'develop':
|
||||||
|
$checked_url = 'https://raw.githubusercontent.com/friendica/friendica/develop/VERSION';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// don't check
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$checkurl = "https://raw.githubusercontent.com/friendica/friendica/".$checkurl."/VERSION";
|
logger("Checking VERSION from: ".$checked_url, LOGGER_DEBUG);
|
||||||
logger("Checking VERSION from: ".$checkurl, LOGGER_DEBUG);
|
|
||||||
$gitversion = dbesc(trim(fetch_url($checkurl)));
|
// fetch the VERSION file
|
||||||
|
$gitversion = dbesc(trim(fetch_url($checked_url)));
|
||||||
logger("Upstream VERSION is: ".$gitversion, LOGGER_DEBUG);
|
logger("Upstream VERSION is: ".$gitversion, LOGGER_DEBUG);
|
||||||
|
|
||||||
Config::set('system', 'git_friendica_version', $gitversion);
|
Config::set('system', 'git_friendica_version', $gitversion);
|
||||||
|
|
||||||
logger('checkversion: end');
|
logger('checkversion: end');
|
||||||
|
|
Loading…
Reference in a new issue