4 * @file src/Worker/CheckVersion.php
6 * @brief save Friendica upstream version to the DB
8 namespace Friendica\Worker;
10 use Friendica\Core\Config;
11 use Friendica\Util\Network;
14 * @brief check the git repository VERSION file and save the version to the DB
16 * Checking the upstream version is optional (opt-in) and can be done to either
17 * the master or the develop branch in the repository.
21 public static function execute()
23 logger('checkversion: start');
25 $checkurl = Config::get('system', 'check_new_version_url', 'none');
29 $checked_url = 'https://raw.githubusercontent.com/friendica/friendica/master/VERSION';
32 $checked_url = 'https://raw.githubusercontent.com/friendica/friendica/develop/VERSION';
38 logger("Checking VERSION from: ".$checked_url, LOGGER_DEBUG);
40 // fetch the VERSION file
41 $gitversion = dbesc(trim(Network::fetchUrl($checked_url)));
42 logger("Upstream VERSION is: ".$gitversion, LOGGER_DEBUG);
44 Config::set('system', 'git_friendica_version', $gitversion);
46 logger('checkversion: end');