]> git.mxchange.org Git - friendica.git/commitdiff
Move PConfig::delete() to DI::pConfig()->delete()
authornupplaPhil <admin@philipp.info>
Sat, 18 Jan 2020 15:56:46 +0000 (16:56 +0100)
committernupplaPhil <admin@philipp.info>
Sat, 18 Jan 2020 15:56:46 +0000 (16:56 +0100)
mod/ostatus_subscribe.php
src/Core/PConfig.php
src/Module/Settings/TwoFactor/Index.php
update.php

index c22572d974b07be01e35cb8804c2087bb1758b17..0ab39e0c89a6586cc233344afdb3ddafcaf30213 100644 (file)
@@ -29,14 +29,14 @@ function ostatus_subscribe_content(App $a)
        if (DI::pConfig()->get($uid, 'ostatus', 'legacy_friends') == '') {
 
                if ($_REQUEST['url'] == '') {
-                       PConfig::delete($uid, 'ostatus', 'legacy_contact');
+                       DI::pConfig()->delete($uid, 'ostatus', 'legacy_contact');
                        return $o . L10n::t('No contact provided.');
                }
 
                $contact = Probe::uri($_REQUEST['url']);
 
                if (!$contact) {
-                       PConfig::delete($uid, 'ostatus', 'legacy_contact');
+                       DI::pConfig()->delete($uid, 'ostatus', 'legacy_contact');
                        return $o . L10n::t('Couldn\'t fetch information for contact.');
                }
 
@@ -46,7 +46,7 @@ function ostatus_subscribe_content(App $a)
                $curlResult = Network::curl($api . 'statuses/friends.json?screen_name=' . $contact['nick']);
 
                if (!$curlResult->isSuccess()) {
-                       PConfig::delete($uid, 'ostatus', 'legacy_contact');
+                       DI::pConfig()->delete($uid, 'ostatus', 'legacy_contact');
                        return $o . L10n::t('Couldn\'t fetch friends for contact.');
                }
 
@@ -63,8 +63,8 @@ function ostatus_subscribe_content(App $a)
 
        if ($counter >= $total) {
                DI::page()['htmlhead'] = '<meta http-equiv="refresh" content="0; URL=' . DI::baseUrl() . '/settings/connectors">';
-               PConfig::delete($uid, 'ostatus', 'legacy_friends');
-               PConfig::delete($uid, 'ostatus', 'legacy_contact');
+               DI::pConfig()->delete($uid, 'ostatus', 'legacy_friends');
+               DI::pConfig()->delete($uid, 'ostatus', 'legacy_contact');
                $o .= L10n::t('Done');
                return $o;
        }
index 39a262d43d92a86c7f2632d4841ac94cd7e4dfee..bb3334c4c9e3ef85df21b25a6a0e3cd50d329b5e 100644 (file)
@@ -19,17 +19,4 @@ use Friendica\DI;
  */
 class PConfig
 {
-       /**
-        * @brief Deletes the given key from the users's configuration.
-        *
-        * @param int    $uid The user_id
-        * @param string $cat The category of the configuration value
-        * @param string $key The configuration key to delete
-        *
-        * @return bool
-        */
-       public static function delete(int $uid, string $cat, string $key)
-       {
-               return DI::pConfig()->delete($uid, $cat, $key);
-       }
 }
index 187d6a15a99ba5a4e3f359ca4d6b34be2874a383..26d40565f7e5698bdbe98efac56ad1baacd15bb2 100644 (file)
@@ -45,8 +45,8 @@ class Index extends BaseSettingsModule
                                case 'disable':
                                        if ($has_secret) {
                                                RecoveryCode::deleteForUser(local_user());
-                                               PConfig::delete(local_user(), '2fa', 'secret');
-                                               PConfig::delete(local_user(), '2fa', 'verified');
+                                               DI::pConfig()->delete(local_user(), '2fa', 'secret');
+                                               DI::pConfig()->delete(local_user(), '2fa', 'verified');
                                                Session::remove('2fa');
 
                                                notice(L10n::t('Two-factor authentication successfully disabled.'));
index b583a64b9f2b4a11c8ebb783cda544d6fe970fe8..0e69f9094385522547f02bdcb684494d9f52527c 100644 (file)
@@ -135,7 +135,7 @@ function update_1191()
                        $value = $rr['v'];
 
                        if ($key === 'randomise') {
-                               PConfig::delete($uid, $family, $key);
+                               DI::pConfig()->delete($uid, $family, $key);
                        }
 
                        if ($key === 'show_on_profile') {
@@ -143,7 +143,7 @@ function update_1191()
                                        DI::pConfig()->set($uid, feature, forumlist_profile, $value);
                                }
 
-                               PConfig::delete($uid, $family, $key);
+                               DI::pConfig()->delete($uid, $family, $key);
                        }
 
                        if ($key === 'show_on_network') {
@@ -151,7 +151,7 @@ function update_1191()
                                        DI::pConfig()->set($uid, feature, forumlist_widget, $value);
                                }
 
-                               PConfig::delete($uid, $family, $key);
+                               DI::pConfig()->delete($uid, $family, $key);
                        }
                }
        }