]> git.mxchange.org Git - friendica.git/commitdiff
Move Config::delete() to DI::config()->delete()
authornupplaPhil <admin@philipp.info>
Sun, 19 Jan 2020 20:22:33 +0000 (21:22 +0100)
committernupplaPhil <admin@philipp.info>
Sun, 19 Jan 2020 20:22:33 +0000 (21:22 +0100)
src/Core/Config.php
src/Module/Admin/Features.php
src/Module/Admin/Site.php
src/Network/FKOAuthDataStore.php
update.php

index 0dd4b22768de85c2e86b9d56f03113b8f260cec2..f641047166ecf444db576a8c4d1bbdae51b6a26e 100644 (file)
@@ -19,16 +19,4 @@ use Friendica\DI;
  */
 class Config
 {
-       /**
-        * Deletes the given key from the system configuration.
-        *
-        * @param string $cat The category of the configuration value
-        * @param string $key    The configuration key to delete
-        *
-        * @return bool
-        */
-       public static function delete($cat, $key)
-       {
-               return DI::config()->delete($cat, $key);
-       }
 }
index 79d6e43f5e5d5e74968f28ec8c6e84965e268b01..b73e35f54993ade1a0b6a1f508843287a21620eb 100644 (file)
@@ -34,7 +34,7 @@ class Features extends BaseAdminModule
                                if (!empty($_POST[$featurelock])) {
                                        DI::config()->set('feature_lock', $feature, $val);
                                } else {
-                                       Config::delete('feature_lock', $feature);
+                                       DI::config()->delete('feature_lock', $feature);
                                }
                        }
                }
index 915eaa5046a5b98c0c5617d23065fad40ae3ca60..035c7c6e0c1a2cbd27e0eb5f36a910fb1f468caf 100644 (file)
@@ -297,13 +297,13 @@ class Site extends BaseAdminModule
                DI::config()->set('system', 'touch_icon'            , $touch_icon);
 
                if ($banner == "") {
-                       Config::delete('system', 'banner');
+                       DI::config()->delete('system', 'banner');
                } else {
                        DI::config()->set('system', 'banner', $banner);
                }
 
                if (empty($additional_info)) {
-                       Config::delete('config', 'info');
+                       DI::config()->delete('config', 'info');
                } else {
                        DI::config()->set('config', 'info', $additional_info);
                }
@@ -312,12 +312,12 @@ class Site extends BaseAdminModule
                Theme::install($theme);
 
                if ($theme_mobile == '---') {
-                       Config::delete('system', 'mobile-theme');
+                       DI::config()->delete('system', 'mobile-theme');
                } else {
                        DI::config()->set('system', 'mobile-theme', $theme_mobile);
                }
                if ($singleuser == '---') {
-                       Config::delete('system', 'singleuser');
+                       DI::config()->delete('system', 'singleuser');
                } else {
                        DI::config()->set('system', 'singleuser', $singleuser);
                }
@@ -417,7 +417,7 @@ class Site extends BaseAdminModule
                if (strlen(DI::config()->get('system', 'directory_submit_url')) &&
                        !strlen(DI::config()->get('system', 'directory'))) {
                        DI::config()->set('system', 'directory', dirname(DI::config()->get('system', 'directory_submit_url')));
-                       Config::delete('system', 'directory_submit_url');
+                       DI::config()->delete('system', 'directory_submit_url');
                }
 
                /* Installed themes */
index 6f0a1ed837495de4af5eb239496fe32a0e795874..ff6a1e21657652b5b0ab4cc6c2d260abfb689159 100644 (file)
@@ -177,7 +177,7 @@ class FKOAuthDataStore extends OAuthDataStore
                DBA::delete('tokens', ['id' => $token->key]);
 
                if (!is_null($ret) && !is_null($uverifier)) {
-                       Config::delete("oauth", $verifier);
+                       DI::config()->delete("oauth", $verifier);
                }
 
                return $ret;
index a40d19785c03fe74fd580f82dd5907c1c9382e69..a038edf210dbe8799b66d8f021d3b1a21e20816a 100644 (file)
@@ -89,7 +89,7 @@ function update_1189()
        if (strlen(DI::config()->get('system', 'directory_submit_url')) &&
                !strlen(DI::config()->get('system', 'directory'))) {
                DI::config()->set('system', 'directory', dirname(DI::config()->get('system', 'directory_submit_url')));
-               Config::delete('system', 'directory_submit_url');
+               DI::config()->delete('system', 'directory_submit_url');
        }
 
        return Update::SUCCESS;
@@ -420,7 +420,7 @@ function update_1330()
                }
 
                // try to delete the class since it isn't needed. This won't work with config files
-               Config::delete('storage', 'class');
+               DI::config()->delete('storage', 'class');
        }
 
        // Update attachments and photos