From 75143e27b5d617887a757f6943b61fc88b69097e Mon Sep 17 00:00:00 2001 From: nupplaPhil Date: Sun, 19 Jan 2020 21:21:52 +0100 Subject: [PATCH] Move Config::set() to DI::config()->set() --- blackout/blackout.php | 6 +++--- blockbot/blockbot.php | 6 +++--- buffer/buffer.php | 4 ++-- cookienotice/cookienotice.php | 4 ++-- curweather/curweather.php | 4 ++-- geocoordinates/geocoordinates.php | 4 ++-- gravatar/gravatar.php | 4 ++-- impressum/impressum.php | 12 ++++++------ irc/irc.php | 4 ++-- jappixmini/jappixmini.php | 18 +++++++++--------- leistungsschutzrecht/leistungsschutzrecht.php | 4 ++-- libravatar/libravatar.php | 2 +- mailstream/mailstream.php | 14 +++++++------- newmemberwidget/newmemberwidget.php | 8 ++++---- openstreetmap/openstreetmap.php | 8 ++++---- pageheader/pageheader.php | 2 +- piwik/piwik.php | 8 ++++---- public_server/public_server.php | 12 ++++++------ pumpio/pumpio.php | 2 +- remote_permissions/remote_permissions.php | 2 +- statusnet/statusnet.php | 4 ++-- tumblr/tumblr.php | 4 ++-- twitter/twitter.php | 8 ++++---- webrtc/webrtc.php | 2 +- xmpp/xmpp.php | 4 ++-- 25 files changed, 75 insertions(+), 75 deletions(-) diff --git a/blackout/blackout.php b/blackout/blackout.php index aee5acc76..eb0b6ce81 100644 --- a/blackout/blackout.php +++ b/blackout/blackout.php @@ -115,7 +115,7 @@ function blackout_addon_admin_post (&$a) { $begindate = trim($_POST['startdate']); $enddate = trim($_POST['enddate']); $url = trim($_POST['rurl']); - Config::set('blackout','begindate',$begindate); - Config::set('blackout','enddate',$enddate); - Config::set('blackout','url',$url); + DI::config()->set('blackout','begindate',$begindate); + DI::config()->set('blackout','enddate',$enddate); + DI::config()->set('blackout','url',$url); } diff --git a/blockbot/blockbot.php b/blockbot/blockbot.php index 0e6cea96c..166fa7b63 100644 --- a/blockbot/blockbot.php +++ b/blockbot/blockbot.php @@ -40,9 +40,9 @@ function blockbot_addon_admin(&$a, &$o) { } function blockbot_addon_admin_post(&$a) { - Config::set('blockbot', 'good_crawlers', $_POST['good_crawlers'] ?? false); - Config::set('blockbot', 'block_gab', $_POST['block_gab'] ?? false); - Config::set('blockbot', 'training', $_POST['training'] ?? false); + DI::config()->set('blockbot', 'good_crawlers', $_POST['good_crawlers'] ?? false); + DI::config()->set('blockbot', 'block_gab', $_POST['block_gab'] ?? false); + DI::config()->set('blockbot', 'training', $_POST['training'] ?? false); info(DI::l10n()->t('Settings updated.'). EOL); } diff --git a/buffer/buffer.php b/buffer/buffer.php index 81625ea6c..175f9a14d 100644 --- a/buffer/buffer.php +++ b/buffer/buffer.php @@ -88,8 +88,8 @@ function buffer_addon_admin_post(App $a) $client_id = (!empty($_POST['client_id']) ? Strings::escapeTags(trim($_POST['client_id'])) : ''); $client_secret = (!empty($_POST['client_secret']) ? Strings::escapeTags(trim($_POST['client_secret'])) : ''); - Config::set('buffer', 'client_id' , $client_id); - Config::set('buffer', 'client_secret', $client_secret); + DI::config()->set('buffer', 'client_id' , $client_id); + DI::config()->set('buffer', 'client_secret', $client_secret); info(DI::l10n()->t('Settings updated.'). EOL); } diff --git a/cookienotice/cookienotice.php b/cookienotice/cookienotice.php index 0cbefe520..2fda864e9 100644 --- a/cookienotice/cookienotice.php +++ b/cookienotice/cookienotice.php @@ -69,8 +69,8 @@ function cookienotice_addon_admin_post(App $a) } if ($_POST['cookienotice-submit']) { - Config::set('cookienotice', 'text', trim(strip_tags($_POST['cookienotice-text']))); - Config::set('cookienotice', 'oktext', trim(strip_tags($_POST['cookienotice-oktext']))); + DI::config()->set('cookienotice', 'text', trim(strip_tags($_POST['cookienotice-text']))); + DI::config()->set('cookienotice', 'oktext', trim(strip_tags($_POST['cookienotice-oktext']))); info(DI::l10n()->t('cookienotice Settings saved.')); } } diff --git a/curweather/curweather.php b/curweather/curweather.php index 4507fadb7..ef1ffabb8 100644 --- a/curweather/curweather.php +++ b/curweather/curweather.php @@ -220,8 +220,8 @@ function curweather_addon_admin_post(App $a) } if (!empty($_POST['curweather-submit'])) { - Config::set('curweather', 'appid', trim($_POST['appid'])); - Config::set('curweather', 'cachetime', trim($_POST['cachetime'])); + DI::config()->set('curweather', 'appid', trim($_POST['appid'])); + DI::config()->set('curweather', 'cachetime', trim($_POST['cachetime'])); info(DI::l10n()->t('Curweather settings saved.' . PHP_EOL)); } diff --git a/geocoordinates/geocoordinates.php b/geocoordinates/geocoordinates.php index fbb89d1c4..85a8f7cc6 100644 --- a/geocoordinates/geocoordinates.php +++ b/geocoordinates/geocoordinates.php @@ -101,9 +101,9 @@ function geocoordinates_addon_admin(&$a, &$o) function geocoordinates_addon_admin_post(&$a) { $api_key = (!empty($_POST['api_key']) ? Strings::escapeTags(trim($_POST['api_key'])) : ''); - Config::set('geocoordinates', 'api_key', $api_key); + DI::config()->set('geocoordinates', 'api_key', $api_key); $language = (!empty($_POST['language']) ? Strings::escapeTags(trim($_POST['language'])) : ''); - Config::set('geocoordinates', 'language', $language); + DI::config()->set('geocoordinates', 'language', $language); info(DI::l10n()->t('Settings updated.') . EOL); } diff --git a/gravatar/gravatar.php b/gravatar/gravatar.php index 8639ae0ec..303c11419 100644 --- a/gravatar/gravatar.php +++ b/gravatar/gravatar.php @@ -124,7 +124,7 @@ function gravatar_addon_admin_post (&$a) { $default_avatar = (!empty($_POST['avatar']) ? Strings::escapeTags(trim($_POST['avatar'])) : 'identicon'); $rating = (!empty($_POST['rating']) ? Strings::escapeTags(trim($_POST['rating'])) : 'g'); - Config::set('gravatar', 'default_avatar', $default_avatar); - Config::set('gravatar', 'rating', $rating); + DI::config()->set('gravatar', 'default_avatar', $default_avatar); + DI::config()->set('gravatar', 'rating', $rating); info(DI::l10n()->t('Gravatar settings updated.') .EOL); } diff --git a/impressum/impressum.php b/impressum/impressum.php index bcbe42359..bff380ad5 100644 --- a/impressum/impressum.php +++ b/impressum/impressum.php @@ -93,12 +93,12 @@ function impressum_addon_admin_post (&$a) { $notes = (!empty($_POST['notes']) ? (trim($_POST['notes'])) : ''); $email = (!empty($_POST['email']) ? Strings::escapeTags(trim($_POST['email'])) : ''); $footer_text = (!empty($_POST['footer_text']) ? (trim($_POST['footer_text'])) : ''); - Config::set('impressum','owner',strip_tags($owner)); - Config::set('impressum','ownerprofile',strip_tags($ownerprofile)); - Config::set('impressum','postal',strip_tags($postal)); - Config::set('impressum','email',strip_tags($email)); - Config::set('impressum','notes',strip_tags($notes)); - Config::set('impressum','footer_text',strip_tags($footer_text)); + DI::config()->set('impressum','owner',strip_tags($owner)); + DI::config()->set('impressum','ownerprofile',strip_tags($ownerprofile)); + DI::config()->set('impressum','postal',strip_tags($postal)); + DI::config()->set('impressum','email',strip_tags($email)); + DI::config()->set('impressum','notes',strip_tags($notes)); + DI::config()->set('impressum','footer_text',strip_tags($footer_text)); info(DI::l10n()->t('Settings updated.'). EOL ); } function impressum_addon_admin (&$a, &$o) { diff --git a/irc/irc.php b/irc/irc.php index 78f9c54c4..ad67b5e81 100644 --- a/irc/irc.php +++ b/irc/irc.php @@ -131,8 +131,8 @@ function irc_addon_admin_post (&$a) { return; if($_POST['irc-submit']) { - Config::set('irc','autochans',trim($_POST['autochans'])); - Config::set('irc','sitechats',trim($_POST['sitechats'])); + DI::config()->set('irc','autochans',trim($_POST['autochans'])); + DI::config()->set('irc','sitechats',trim($_POST['sitechats'])); /* stupid pop-up thing */ info(DI::l10n()->t('IRC settings saved.') . EOL); } diff --git a/jappixmini/jappixmini.php b/jappixmini/jappixmini.php index 9cf7d5b25..8d93f9409 100644 --- a/jappixmini/jappixmini.php +++ b/jappixmini/jappixmini.php @@ -88,7 +88,7 @@ function jappixmini_install() // set standard configuration $info_text = DI::config()->get("jappixmini", "infotext"); if (!$info_text) - Config::set("jappixmini", "infotext", "To get the chat working, you need to know a BOSH host which works with your Jabber account. " . + DI::config()->set("jappixmini", "infotext", "To get the chat working, you need to know a BOSH host which works with your Jabber account. " . "An example of a BOSH server that works for all accounts is https://bind.jappix.com/, but keep " . "in mind that the BOSH server can read along all chat messages. If you know that your Jabber " . "server also provides an own BOSH server, it is much better to use this one!" @@ -96,13 +96,13 @@ function jappixmini_install() $bosh_proxy = DI::config()->get("jappixmini", "bosh_proxy"); if ($bosh_proxy === "") { - Config::set("jappixmini", "bosh_proxy", "1"); + DI::config()->set("jappixmini", "bosh_proxy", "1"); } // set addon version so that safe updates are possible later $addon_version = DI::config()->get("jappixmini", "version"); if ($addon_version === "") { - Config::set("jappixmini", "version", "1"); + DI::config()->set("jappixmini", "version", "1"); } } @@ -173,11 +173,11 @@ function jappixmini_addon_admin_post(App $a) $default_user = intval($_REQUEST['jappixmini-defaultuser']); $bosh_address = $_REQUEST['jappixmini-address']; $default_server = $_REQUEST['jappixmini-server']; - Config::set("jappixmini", "infotext", $info_text); - Config::set("jappixmini", "bosh_proxy", $bosh_proxy); - Config::set("jappixmini", "bosh_address", $bosh_address); - Config::set("jappixmini", "default_server", $default_server); - Config::set("jappixmini", "default_user", $default_user); + DI::config()->set("jappixmini", "infotext", $info_text); + DI::config()->set("jappixmini", "bosh_proxy", $bosh_proxy); + DI::config()->set("jappixmini", "bosh_address", $bosh_address); + DI::config()->set("jappixmini", "default_server", $default_server); + DI::config()->set("jappixmini", "default_user", $default_user); } } @@ -580,7 +580,7 @@ function jappixmini_login(App $a, &$o) function jappixmini_cron(App $a, $d) { // For autosubscribe/autoapprove, we need to maintain a list of jabber addresses of our contacts. - Config::set("jappixmini", "last_cron_execution", $d); + DI::config()->set("jappixmini", "last_cron_execution", $d); // go through list of users with jabber enabled $users = q("SELECT `uid` FROM `pconfig` WHERE `cat`='jappixmini' AND (`k`='autosubscribe' OR `k`='autoapprove') AND `v`='1'"); diff --git a/leistungsschutzrecht/leistungsschutzrecht.php b/leistungsschutzrecht/leistungsschutzrecht.php index 9e7ad02f2..23aa3abb4 100644 --- a/leistungsschutzrecht/leistungsschutzrecht.php +++ b/leistungsschutzrecht/leistungsschutzrecht.php @@ -126,7 +126,7 @@ function leistungsschutzrecht_fetchsites() */ if (sizeof($sites)) { - Config::set('leistungsschutzrecht','sites',$sites); + DI::config()->set('leistungsschutzrecht','sites',$sites); } } @@ -171,6 +171,6 @@ function leistungsschutzrecht_cron($a,$b) { } } leistungsschutzrecht_fetchsites(); - Config::set('leistungsschutzrecht','last_poll', time()); + DI::config()->set('leistungsschutzrecht','last_poll', time()); } ?> diff --git a/libravatar/libravatar.php b/libravatar/libravatar.php index 7765284da..1d70da0a1 100644 --- a/libravatar/libravatar.php +++ b/libravatar/libravatar.php @@ -126,6 +126,6 @@ function libravatar_addon_admin_post(&$a) BaseModule::checkFormSecurityToken('libravatarrsave'); $default_avatar = (!empty($_POST['avatar']) ? Strings::escapeTags(trim($_POST['avatar'])) : 'identicon'); - Config::set('libravatar', 'default_avatar', $default_avatar); + DI::config()->set('libravatar', 'default_avatar', $default_avatar); info(DI::l10n()->t('Libravatar settings updated.') .EOL); } diff --git a/mailstream/mailstream.php b/mailstream/mailstream.php index 74a3333df..e71e1d500 100644 --- a/mailstream/mailstream.php +++ b/mailstream/mailstream.php @@ -29,23 +29,23 @@ function mailstream_install() { q('ALTER TABLE `mailstream_item` DROP INDEX `contact-id`'); q('ALTER TABLE `mailstream_item` DROP INDEX `plink`'); q('ALTER TABLE `mailstream_item` CHANGE `plink` `uri` char(255) NOT NULL'); - Config::set('mailstream', 'dbversion', '0.2'); + DI::config()->set('mailstream', 'dbversion', '0.2'); } if (DI::config()->get('mailstream', 'dbversion') == '0.2') { q('DELETE FROM `pconfig` WHERE `cat` = "mailstream" AND `k` = "delay"'); - Config::set('mailstream', 'dbversion', '0.3'); + DI::config()->set('mailstream', 'dbversion', '0.3'); } if (DI::config()->get('mailstream', 'dbversion') == '0.3') { q('ALTER TABLE `mailstream_item` CHANGE `created` `created` timestamp NOT NULL DEFAULT now()'); q('ALTER TABLE `mailstream_item` CHANGE `completed` `completed` timestamp NULL DEFAULT NULL'); - Config::set('mailstream', 'dbversion', '0.4'); + DI::config()->set('mailstream', 'dbversion', '0.4'); } if (DI::config()->get('mailstream', 'dbversion') == '0.4') { q('ALTER TABLE `mailstream_item` CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin'); - Config::set('mailstream', 'dbversion', '0.5'); + DI::config()->set('mailstream', 'dbversion', '0.5'); } if (DI::config()->get('mailstream', 'dbversion') == '0.5') { - Config::set('mailstream', 'dbversion', '1.0'); + DI::config()->set('mailstream', 'dbversion', '1.0'); } if (DI::config()->get('retriever', 'dbversion') != '1.0') { @@ -54,7 +54,7 @@ function mailstream_install() { foreach ($arr as $a) { $r = q($a); } - Config::set('mailstream', 'dbversion', '1.0'); + DI::config()->set('mailstream', 'dbversion', '1.0'); } } @@ -87,7 +87,7 @@ function mailstream_addon_admin(&$a,&$o) { function mailstream_addon_admin_post ($a) { if (!empty($_POST['frommail'])) { - Config::set('mailstream', 'frommail', $_POST['frommail']); + DI::config()->set('mailstream', 'frommail', $_POST['frommail']); } } diff --git a/newmemberwidget/newmemberwidget.php b/newmemberwidget/newmemberwidget.php index 21cb482fc..103d158ac 100644 --- a/newmemberwidget/newmemberwidget.php +++ b/newmemberwidget/newmemberwidget.php @@ -58,10 +58,10 @@ function newmemberwidget_addon_admin_post(&$a) $lsn = (!empty($_POST['localsupportname']) ? Strings::escapeTags(trim($_POST['localsupportname'])) : ""); $gs = intval($_POST['linkglobalsupport']); $ls = intval($_POST['linklocalsupport']); - Config::set('newmemberwidget', 'freetext', trim($ft)); - Config::set('newmemberwidget', 'linkglobalsupport', $gs); - Config::set('newmemberwidget', 'linklocalsupport', $ls); - Config::set('newmemberwidget', 'localsupport', trim($lsn)); + DI::config()->set('newmemberwidget', 'freetext', trim($ft)); + DI::config()->set('newmemberwidget', 'linkglobalsupport', $gs); + DI::config()->set('newmemberwidget', 'linklocalsupport', $ls); + DI::config()->set('newmemberwidget', 'localsupport', trim($lsn)); } function newmemberwidget_addon_admin(&$a, &$o) diff --git a/openstreetmap/openstreetmap.php b/openstreetmap/openstreetmap.php index 4391d1b00..dd56b07c7 100644 --- a/openstreetmap/openstreetmap.php +++ b/openstreetmap/openstreetmap.php @@ -220,10 +220,10 @@ function openstreetmap_addon_admin_post(&$a) $zoom = ($_POST['zoom'] ?? '') ?: OSM_ZOOM; $marker = ($_POST['marker'] ?? '') ?: OSM_MARKER; - Config::set('openstreetmap', 'tmsserver', $urltms); - Config::set('openstreetmap', 'nomserver', $urlnom); - Config::set('openstreetmap', 'zoom', $zoom); - Config::set('openstreetmap', 'marker', $marker); + DI::config()->set('openstreetmap', 'tmsserver', $urltms); + DI::config()->set('openstreetmap', 'nomserver', $urlnom); + DI::config()->set('openstreetmap', 'zoom', $zoom); + DI::config()->set('openstreetmap', 'marker', $marker); info(DI::l10n()->t('Settings updated.') . EOL); } diff --git a/pageheader/pageheader.php b/pageheader/pageheader.php index 59a52c4f7..1da4a42ff 100644 --- a/pageheader/pageheader.php +++ b/pageheader/pageheader.php @@ -50,7 +50,7 @@ function pageheader_addon_admin_post(App $a) if(!empty($_POST['pageheader-submit'])) { if (isset($_POST['pageheader-words'])) { - Config::set('pageheader', 'text', trim(strip_tags($_POST['pageheader-words']))); + DI::config()->set('pageheader', 'text', trim(strip_tags($_POST['pageheader-words']))); } info(DI::l10n()->t('pageheader Settings saved.')); } diff --git a/piwik/piwik.php b/piwik/piwik.php index 3ec08bfaa..0b4322428 100644 --- a/piwik/piwik.php +++ b/piwik/piwik.php @@ -114,9 +114,9 @@ function piwik_addon_admin_post (&$a) { $id = (!empty($_POST['siteid']) ? trim($_POST['siteid']) : ''); $optout = (!empty($_POST['optout']) ? trim($_POST['optout']) : ''); $async = (!empty($_POST['async']) ? trim($_POST['async']) : ''); - Config::set('piwik', 'baseurl', $url); - Config::set('piwik', 'siteid', $id); - Config::set('piwik', 'optout', $optout); - Config::set('piwik', 'async', $async); + DI::config()->set('piwik', 'baseurl', $url); + DI::config()->set('piwik', 'siteid', $id); + DI::config()->set('piwik', 'optout', $optout); + DI::config()->set('piwik', 'async', $async); info(DI::l10n()->t('Settings updated.'). EOL); } diff --git a/public_server/public_server.php b/public_server/public_server.php index 5a4dde802..098e0d4a7 100644 --- a/public_server/public_server.php +++ b/public_server/public_server.php @@ -154,12 +154,12 @@ function public_server_addon_admin_post(&$a) $flagusers = (!empty($_POST['flagusers']) ? Strings::escapeTags(trim($_POST['flagusers'])) : ''); $flagposts = (!empty($_POST['flagposts']) ? Strings::escapeTags(trim($_POST['flagposts'])) : ''); $flagpostsexpire = (!empty($_POST['flagpostsexpire']) ? Strings::escapeTags(trim($_POST['flagpostsexpire'])) : ''); - Config::set('public_server', 'expiredays', $expiredays); - Config::set('public_server', 'expireposts', $expireposts); - Config::set('public_server', 'nologin', $nologin); - Config::set('public_server', 'flagusers', $flagusers); - Config::set('public_server', 'flagposts', $flagposts); - Config::set('public_server', 'flagpostsexpire', $flagpostsexpire); + DI::config()->set('public_server', 'expiredays', $expiredays); + DI::config()->set('public_server', 'expireposts', $expireposts); + DI::config()->set('public_server', 'nologin', $nologin); + DI::config()->set('public_server', 'flagusers', $flagusers); + DI::config()->set('public_server', 'flagposts', $flagposts); + DI::config()->set('public_server', 'flagpostsexpire', $flagpostsexpire); info(DI::l10n()->t('Settings saved').EOL); } diff --git a/pumpio/pumpio.php b/pumpio/pumpio.php index 5fed2fbeb..3a29a203a 100644 --- a/pumpio/pumpio.php +++ b/pumpio/pumpio.php @@ -745,7 +745,7 @@ function pumpio_sync(App $a) Logger::log('pumpio: cron_end'); - Config::set('pumpio', 'last_poll', time()); + DI::config()->set('pumpio', 'last_poll', time()); } function pumpio_cron(App $a, $b) diff --git a/remote_permissions/remote_permissions.php b/remote_permissions/remote_permissions.php index 134a09c02..ad4f1bfb5 100644 --- a/remote_permissions/remote_permissions.php +++ b/remote_permissions/remote_permissions.php @@ -209,6 +209,6 @@ function remote_permissions_addon_admin(&$a, &$o){ function remote_permissions_addon_admin_post(&$a){ $choice = (!empty($_POST['remotepermschoice']) ? Strings::escapeTags(trim($_POST['remotepermschoice'])) : ''); - Config::set('remote_perms','global',($choice == 1 ? 1 : 0)); + DI::config()->set('remote_perms','global',($choice == 1 ? 1 : 0)); info(DI::l10n()->t('Settings updated.'). EOL); } diff --git a/statusnet/statusnet.php b/statusnet/statusnet.php index c9fb437a8..e08229678 100644 --- a/statusnet/statusnet.php +++ b/statusnet/statusnet.php @@ -685,7 +685,7 @@ function statusnet_addon_admin_post(App $a) } } - $sites = Config::set('statusnet', 'sites', $sites); + $sites = DI::config()->set('statusnet', 'sites', $sites); } function statusnet_addon_admin(App $a, &$o) @@ -815,7 +815,7 @@ function statusnet_cron(App $a, $b) Logger::log('statusnet: cron_end'); - Config::set('statusnet', 'last_poll', time()); + DI::config()->set('statusnet', 'last_poll', time()); } function statusnet_fetchtimeline(App $a, $uid) diff --git a/tumblr/tumblr.php b/tumblr/tumblr.php index 5d413412f..c5a07453a 100644 --- a/tumblr/tumblr.php +++ b/tumblr/tumblr.php @@ -88,8 +88,8 @@ function tumblr_addon_admin_post(App $a) $consumer_key = (!empty($_POST['consumer_key']) ? Strings::escapeTags(trim($_POST['consumer_key'])) : ''); $consumer_secret = (!empty($_POST['consumer_secret']) ? Strings::escapeTags(trim($_POST['consumer_secret'])): ''); - Config::set('tumblr', 'consumer_key',$consumer_key); - Config::set('tumblr', 'consumer_secret',$consumer_secret); + DI::config()->set('tumblr', 'consumer_key',$consumer_key); + DI::config()->set('tumblr', 'consumer_secret',$consumer_secret); info(DI::l10n()->t('Settings updated.'). EOL); } diff --git a/twitter/twitter.php b/twitter/twitter.php index d9f086d53..b9ec71af7 100644 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -699,7 +699,7 @@ function twitter_post_hook(App $a, array &$b) Logger::info('twitter_post send', ['id' => $b['id'], 'result' => $result]); if (!empty($result->source)) { - Config::set("twitter", "application_name", strip_tags($result->source)); + DI::config()->set("twitter", "application_name", strip_tags($result->source)); } if (!empty($result->errors)) { @@ -716,8 +716,8 @@ function twitter_addon_admin_post(App $a) { $consumerkey = !empty($_POST['consumerkey']) ? Strings::escapeTags(trim($_POST['consumerkey'])) : ''; $consumersecret = !empty($_POST['consumersecret']) ? Strings::escapeTags(trim($_POST['consumersecret'])) : ''; - Config::set('twitter', 'consumerkey', $consumerkey); - Config::set('twitter', 'consumersecret', $consumersecret); + DI::config()->set('twitter', 'consumerkey', $consumerkey); + DI::config()->set('twitter', 'consumersecret', $consumersecret); info(DI::l10n()->t('Settings updated.') . EOL); } @@ -798,7 +798,7 @@ function twitter_cron(App $a) Logger::notice('twitter: cron_end'); - Config::set('twitter', 'last_poll', time()); + DI::config()->set('twitter', 'last_poll', time()); } function twitter_expire(App $a) diff --git a/webrtc/webrtc.php b/webrtc/webrtc.php index 661ebbc16..c28d84c3a 100644 --- a/webrtc/webrtc.php +++ b/webrtc/webrtc.php @@ -34,7 +34,7 @@ function webrtc_addon_admin (&$a, &$o) { } function webrtc_addon_admin_post (&$a) { $url = (!empty($_POST['webrtcurl']) ? Strings::escapeTags(trim($_POST['webrtcurl'])) : ''); - Config::set('webrtc', 'webrtcurl', $url); + DI::config()->set('webrtc', 'webrtcurl', $url); info(DI::l10n()->t('Settings updated.'). EOL); } diff --git a/xmpp/xmpp.php b/xmpp/xmpp.php index e35ac9132..c7bf5f7bf 100644 --- a/xmpp/xmpp.php +++ b/xmpp/xmpp.php @@ -120,8 +120,8 @@ function xmpp_addon_admin_post() $bosh_proxy = (!empty($_POST['bosh_proxy']) ? trim($_POST['bosh_proxy']) : ''); $central_userbase = (!empty($_POST['central_userbase']) ? intval($_POST['central_userbase']) : false); - Config::set('xmpp', 'bosh_proxy', $bosh_proxy); - Config::set('xmpp', 'central_userbase', $central_userbase); + DI::config()->set('xmpp', 'bosh_proxy', $bosh_proxy); + DI::config()->set('xmpp', 'central_userbase', $central_userbase); info(DI::l10n()->t('Settings updated.') . EOL); }