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\Core\Logger;
12 use Friendica\Database\DBA;
13 use Friendica\Util\Network;
16 * @brief check the git repository VERSION file and save the version to the DB
18 * Checking the upstream version is optional (opt-in) and can be done to either
19 * the master or the develop branch in the repository.
23 public static function execute()
25 Logger::log('checkversion: start');
27 $checkurl = Config::get('system', 'check_new_version_url', 'none');
31 $checked_url = 'https://raw.githubusercontent.com/friendica/friendica/master/VERSION';
34 $checked_url = 'https://raw.githubusercontent.com/friendica/friendica/develop/VERSION';
40 Logger::log("Checking VERSION from: ".$checked_url, Logger::DEBUG);
42 // fetch the VERSION file
43 $gitversion = DBA::escape(trim(Network::fetchUrl($checked_url)));
44 Logger::log("Upstream VERSION is: ".$gitversion, Logger::DEBUG);
46 Config::set('system', 'git_friendica_version', $gitversion);
48 Logger::log('checkversion: end');