]> git.mxchange.org Git - friendica.git/blob - include/checkversion.php
dont use the entire url as option
[friendica.git] / include / checkversion.php
1 <?php
2
3 /**
4  * @file include/checkversion.php
5  *
6  * @brief save Friendica upstream version to the DB
7  **/
8
9 use Friendica\Core\Config;
10
11 /**
12  * @brief check the git repository VERSION file and save the version to the DB
13  *
14  * Checking the upstream version is optional (opt-in) and can be done to either
15  * the master or the develop branch in the repository.
16  */
17 function checkversion_run () {
18         global $a;
19
20         logger('checkversion: start');
21
22         $checkurl = Config::get('system', 'check_new_version_url', 'none');
23
24         // check for new versions at all?
25         if ($checkurl == 'none' ) {
26                 return;
27         }
28         $gitversion = dbesc(trim(fetch_url("https://raw.githubusercontent.com/friendica/friendica/".$checkurl."/VERSION")));
29         Config::set('system', 'git_friendica_version', $gitversion);
30
31         logger('checkversion: end');
32
33         return;
34 }