4 * @file src/Worker/CheckVersion.php
6 * save Friendica upstream version to the DB
8 namespace Friendica\Worker;
10 use Friendica\Core\Config;
11 use Friendica\Core\Logger;
12 use Friendica\Database\DBA;
14 use Friendica\Util\Network;
17 * check the git repository VERSION file and save the version to the DB
19 * Checking the upstream version is optional (opt-in) and can be done to either
20 * the master or the develop branch in the repository.
24 public static function execute()
26 Logger::log('checkversion: start');
28 $checkurl = DI::config()->get('system', 'check_new_version_url', 'none');
32 $checked_url = 'https://raw.githubusercontent.com/friendica/friendica/master/VERSION';
35 $checked_url = 'https://raw.githubusercontent.com/friendica/friendica/develop/VERSION';
41 Logger::log("Checking VERSION from: ".$checked_url, Logger::DEBUG);
43 // fetch the VERSION file
44 $gitversion = DBA::escape(trim(Network::fetchUrl($checked_url)));
45 Logger::log("Upstream VERSION is: ".$gitversion, Logger::DEBUG);
47 DI::config()->set('system', 'git_friendica_version', $gitversion);
49 Logger::log('checkversion: end');