Merge pull request #12718 from annando/config

More configs moved to key values
This commit is contained in:
Hypolite Petovan 2023-01-22 16:31:17 -05:00 committed by GitHub
commit 6fe85d9e2c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 4 deletions

View file

@ -1,6 +1,6 @@
-- ------------------------------------------ -- ------------------------------------------
-- Friendica 2023.03-dev (Giant Rhubarb) -- Friendica 2023.03-dev (Giant Rhubarb)
-- DB_UPDATE_VERSION 1512 -- DB_UPDATE_VERSION 1513
-- ------------------------------------------ -- ------------------------------------------

View file

@ -79,7 +79,8 @@ class Summary extends BaseAdmin
// Check if github.com/friendica/stable/VERSION is higher then // Check if github.com/friendica/stable/VERSION is higher then
// the local version of Friendica. Check is opt-in, source may be stable or develop branch // the local version of Friendica. Check is opt-in, source may be stable or develop branch
if (DI::config()->get('system', 'check_new_version_url', 'none') != 'none') { if (DI::config()->get('system', 'check_new_version_url', 'none') != 'none') {
$gitversion = DI::config()->get('system', 'git_friendica_version'); $gitversion = DI::keyValue()->get('git_friendica_version') ?? '';
if (version_compare(App::VERSION, $gitversion) < 0) { if (version_compare(App::VERSION, $gitversion) < 0) {
$warningtext[] = DI::l10n()->t('There is a new version of Friendica available for download. Your current version is %1$s, upstream version is %2$s', App::VERSION, $gitversion); $warningtext[] = DI::l10n()->t('There is a new version of Friendica available for download. Your current version is %1$s, upstream version is %2$s', App::VERSION, $gitversion);
} }

View file

@ -58,7 +58,7 @@ class CheckVersion
$gitversion = DBA::escape(trim(DI::httpClient()->fetch($checked_url, HttpClientAccept::TEXT))); $gitversion = DBA::escape(trim(DI::httpClient()->fetch($checked_url, HttpClientAccept::TEXT)));
Logger::notice("Upstream VERSION is: ".$gitversion); Logger::notice("Upstream VERSION is: ".$gitversion);
DI::config()->set('system', 'git_friendica_version', $gitversion); DI::keyValue()->set('git_friendica_version', $gitversion);
Logger::notice('checkversion: end'); Logger::notice('checkversion: end');

View file

@ -55,7 +55,7 @@
use Friendica\Database\DBA; use Friendica\Database\DBA;
if (!defined('DB_UPDATE_VERSION')) { if (!defined('DB_UPDATE_VERSION')) {
define('DB_UPDATE_VERSION', 1512); define('DB_UPDATE_VERSION', 1513);
} }
return [ return [

View file

@ -1244,3 +1244,12 @@ function update_1512()
DI::config()->delete('nodeinfo', 'local_posts'); DI::config()->delete('nodeinfo', 'local_posts');
DI::config()->delete('nodeinfo', 'local_comments'); DI::config()->delete('nodeinfo', 'local_comments');
} }
function update_1513()
{
DI::keyValue()->set('git_friendica_version', DI::config()->get('system', 'git_friendica_version'));
DI::keyValue()->set('twitter_application_name', DI::config()->get('twitter', 'application_name'));
DI::config()->delete('system', 'git_friendica_version');
DI::config()->delete('twitter', 'application_name');
}