]> git.mxchange.org Git - friendica.git/commitdiff
Move Config::set() to DI::config()->set()
authornupplaPhil <admin@philipp.info>
Sun, 19 Jan 2020 20:21:53 +0000 (21:21 +0100)
committernupplaPhil <admin@philipp.info>
Sun, 19 Jan 2020 20:21:53 +0000 (21:21 +0100)
29 files changed:
bin/daemon.php
boot.php
mod/api.php
src/Core/Addon.php
src/Core/Config.php
src/Core/Theme.php
src/Core/Update.php
src/Core/Worker.php
src/Database/DBStructure.php
src/Database/PostUpdate.php
src/Model/GServer.php
src/Module/Admin/Blocklist/Server.php
src/Module/Admin/DBSync.php
src/Module/Admin/Features.php
src/Module/Admin/Logs/Settings.php
src/Module/Admin/Site.php
src/Module/Admin/Summary.php
src/Module/Admin/Tos.php
src/Protocol/DFRN.php
src/Worker/CheckVersion.php
src/Worker/Cron.php
src/Worker/CronJobs.php
src/Worker/DBClean.php
tests/src/Database/DBATest.php
update.php
view/theme/duepuntozero/config.php
view/theme/frio/config.php
view/theme/quattro/config.php
view/theme/vier/config.php

index 8de6e1a4cff0d862591ed336efdd6903e97a0bb2..0536814b9a25a2f1b74eae3a770a2c477a66a47b 100755 (executable)
@@ -88,7 +88,7 @@ if (is_readable($pidfile)) {
 }
 
 if (empty($pid) && in_array($mode, ["stop", "status"])) {
-       Config::set('system', 'worker_daemon_mode', false);
+       DI::config()->set('system', 'worker_daemon_mode', false);
        die("Pidfile wasn't found. Is the daemon running?\n");
 }
 
@@ -99,7 +99,7 @@ if ($mode == "status") {
 
        unlink($pidfile);
 
-       Config::set('system', 'worker_daemon_mode', false);
+       DI::config()->set('system', 'worker_daemon_mode', false);
        die("Daemon process $pid isn't running.\n");
 }
 
@@ -110,7 +110,7 @@ if ($mode == "stop") {
 
        Logger::notice("Worker daemon process was killed", ["pid" => $pid]);
 
-       Config::set('system', 'worker_daemon_mode', false);
+       DI::config()->set('system', 'worker_daemon_mode', false);
        die("Worker daemon process $pid was killed.\n");
 }
 
@@ -153,7 +153,7 @@ if (!$foreground) {
        DBA::reconnect();
 }
 
-Config::set('system', 'worker_daemon_mode', true);
+DI::config()->set('system', 'worker_daemon_mode', true);
 
 // Just to be sure that this script really runs endlessly
 set_time_limit(0);
index 92be83ed0e509ed709c693d63f7b20b3209f5dc6..5f8f3a3be3494a9929e7b921eb28d49b318949c7 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -470,7 +470,7 @@ function get_temppath()
 
                if (System::isDirectoryUsable($new_temppath)) {
                        // The new path is usable, we are happy
-                       Config::set("system", "temppath", $new_temppath);
+                       DI::config()->set("system", "temppath", $new_temppath);
                        return $new_temppath;
                } else {
                        // We can't create a subdirectory, strange.
@@ -563,7 +563,7 @@ function get_itemcachepath()
                }
 
                if (System::isDirectoryUsable($itemcache)) {
-                       Config::set("system", "itemcache", $itemcache);
+                       DI::config()->set("system", "itemcache", $itemcache);
                        return $itemcache;
                }
        }
@@ -595,7 +595,7 @@ function get_spoolpath()
 
                if (System::isDirectoryUsable($spoolpath)) {
                        // The new path is usable, we are happy
-                       Config::set("system", "spoolpath", $spoolpath);
+                       DI::config()->set("system", "spoolpath", $spoolpath);
                        return $spoolpath;
                } else {
                        // We can't create a subdirectory, strange.
index 3ed19e75bff2f9bc8c9af58e139c2aaf2197273c..48a1e4d46ed0031fcb3adb3fa2f32365af485f0e 100644 (file)
@@ -68,7 +68,7 @@ function api_content(App $a)
                        $consumer = new OAuthConsumer($app['client_id'], $app['pw'], $app['redirect_uri']);
 
                        $verifier = md5($app['secret'] . local_user());
-                       Config::set("oauth", $verifier, local_user());
+                       DI::config()->set("oauth", $verifier, local_user());
 
                        if ($consumer->callback_url != null) {
                                $params = $request->get_parameters();
index 64514836827a772ae85c719a8ec9206d12f4c1a0..5f1865b554898608aff5616a3c0539660417587b 100644 (file)
@@ -348,7 +348,7 @@ class Addon
         */
        public static function saveEnabledList()
        {
-               return Config::set('system', 'addon', implode(',', self::$addons));
+               return DI::config()->set('system', 'addon', implode(',', self::$addons));
        }
 
        /**
index 13bd8ddaf60bf2c2685e5b538023ca94c83e503c..0dd4b22768de85c2e86b9d56f03113b8f260cec2 100644 (file)
@@ -19,22 +19,6 @@ use Friendica\DI;
  */
 class Config
 {
-       /**
-        * Stores a config value ($value) in the category ($cat) under the key ($key)
-        *
-        * Note: Please do not store booleans - convert to 0/1 integer values!
-        *
-        * @param string $cat The category of the configuration value
-        * @param string $key    The configuration key to set
-        * @param mixed  $value  The value to store
-        *
-        * @return bool Operation success
-        */
-       public static function set($cat, $key, $value)
-       {
-               return DI::config()->set($cat, $key, $value);
-       }
-
        /**
         * Deletes the given key from the system configuration.
         *
index 7339157af5261a16ea97827c468cedc4e483d98e..76149b7589acae9fc829a2f984b41bb550d8e507 100644 (file)
@@ -36,7 +36,7 @@ class Theme
 
        public static function setAllowedList(array $allowed_themes)
        {
-               Config::set('system', 'allowed_themes', implode(',', array_unique($allowed_themes)));
+               DI::config()->set('system', 'allowed_themes', implode(',', array_unique($allowed_themes)));
        }
 
        /**
index 02a39219a104808a06922e1a5903d23180c7ae88..5a151b8380916311b057c04d1c65a9a6e3140e34 100644 (file)
@@ -36,7 +36,7 @@ class Update
                $build = DI::config()->get('system', 'build');
 
                if (empty($build)) {
-                       Config::set('system', 'build', DB_UPDATE_VERSION - 1);
+                       DI::config()->set('system', 'build', DB_UPDATE_VERSION - 1);
                        $build = DB_UPDATE_VERSION - 1;
                }
 
@@ -81,7 +81,7 @@ class Update
 
                if (empty($build) || ($build > DB_UPDATE_VERSION)) {
                        $build = DB_UPDATE_VERSION - 1;
-                       Config::set('system', 'build', $build);
+                       DI::config()->set('system', 'build', $build);
                }
 
                if ($build != DB_UPDATE_VERSION || $force) {
@@ -110,7 +110,7 @@ class Update
                                        for ($x = $stored + 1; $x <= $current; $x++) {
                                                $r = self::runUpdateFunction($x, 'pre_update');
                                                if (!$r) {
-                                                       Config::set('system', 'update', Update::FAILED);
+                                                       DI::config()->set('system', 'update', Update::FAILED);
                                                        DI::lock()->release('dbupdate');
                                                        return $r;
                                                }
@@ -126,12 +126,12 @@ class Update
                                                        );
                                                }
                                                Logger::error('Update ERROR.', ['from' => $stored, 'to' => $current, 'retval' => $retval]);
-                                               Config::set('system', 'update', Update::FAILED);
+                                               DI::config()->set('system', 'update', Update::FAILED);
                                                DI::lock()->release('dbupdate');
                                                return $retval;
                                        } else {
-                                               Config::set('database', 'last_successful_update', $current);
-                                               Config::set('database', 'last_successful_update_time', time());
+                                               DI::config()->set('database', 'last_successful_update', $current);
+                                               DI::config()->set('database', 'last_successful_update_time', time());
                                                Logger::info('Update finished.', ['from' => $stored, 'to' => $current]);
                                        }
 
@@ -139,7 +139,7 @@ class Update
                                        for ($x = $stored + 1; $x <= $current; $x++) {
                                                $r = self::runUpdateFunction($x, 'update');
                                                if (!$r) {
-                                                       Config::set('system', 'update', Update::FAILED);
+                                                       DI::config()->set('system', 'update', Update::FAILED);
                                                        DI::lock()->release('dbupdate');
                                                        return $r;
                                                }
@@ -150,7 +150,7 @@ class Update
                                                self::updateSuccessfull($stored, $current);
                                        }
 
-                                       Config::set('system', 'update', Update::SUCCESS);
+                                       DI::config()->set('system', 'update', Update::SUCCESS);
                                        DI::lock()->release('dbupdate');
                                }
                        }
@@ -197,11 +197,11 @@ class Update
                                        DI::lock()->release('dbupdate_function');
                                        return false;
                                } else {
-                                       Config::set('database', 'last_successful_update_function', $funcname);
-                                       Config::set('database', 'last_successful_update_function_time', time());
+                                       DI::config()->set('database', 'last_successful_update_function', $funcname);
+                                       DI::config()->set('database', 'last_successful_update_function_time', time());
 
                                        if ($prefix == 'update') {
-                                               Config::set('system', 'build', $x);
+                                               DI::config()->set('system', 'build', $x);
                                        }
 
                                        DI::lock()->release('dbupdate_function');
@@ -212,11 +212,11 @@ class Update
                } else {
                        Logger::info('Update function skipped.', ['function' => $funcname]);
 
-                       Config::set('database', 'last_successful_update_function', $funcname);
-                       Config::set('database', 'last_successful_update_function_time', time());
+                       DI::config()->set('database', 'last_successful_update_function', $funcname);
+                       DI::config()->set('database', 'last_successful_update_function_time', time());
 
                        if ($prefix == 'update') {
-                               Config::set('system', 'build', $x);
+                               DI::config()->set('system', 'build', $x);
                        }
 
                        return true;
index da38cba10a116fd639375312e7a06a5774c64010..562a17c0a2a73f1651ca251d475d0c58a93a5e9f 100644 (file)
@@ -65,7 +65,7 @@ class Worker
                // Kill stale processes every 5 minutes
                $last_cleanup = DI::config()->get('system', 'worker_last_cleaned', 0);
                if (time() > ($last_cleanup + 300)) {
-                       Config::set('system', 'worker_last_cleaned', time());
+                       DI::config()->set('system', 'worker_last_cleaned', time());
                        self::killStaleWorkers();
                }
 
@@ -297,7 +297,7 @@ class Worker
                        $stamp = (float)microtime(true);
                        $condition = ["`id` = ? AND `next_try` < ?", $queue['id'], DateTimeFormat::utcNow()];
                        if (DBA::update('workerqueue', ['done' => true], $condition)) {
-                               Config::set('system', 'last_worker_execution', DateTimeFormat::utcNow());
+                               DI::config()->set('system', 'last_worker_execution', DateTimeFormat::utcNow());
                        }
                        self::$db_duration = (microtime(true) - $stamp);
                        self::$db_duration_write += (microtime(true) - $stamp);
@@ -343,7 +343,7 @@ class Worker
 
                        $stamp = (float)microtime(true);
                        if (DBA::update('workerqueue', ['done' => true], ['id' => $queue["id"]])) {
-                               Config::set('system', 'last_worker_execution', DateTimeFormat::utcNow());
+                               DI::config()->set('system', 'last_worker_execution', DateTimeFormat::utcNow());
                        }
                        self::$db_duration = (microtime(true) - $stamp);
                        self::$db_duration_write += (microtime(true) - $stamp);
@@ -1004,7 +1004,7 @@ class Worker
                                return;
                        }
 
-                       Config::set("system", "worker_started", time());
+                       DI::config()->set("system", "worker_started", time());
 
                        // Do we have enough running workers? Then we quit here.
                        if (self::tooMuchWorkers()) {
index d70f7f4ec6b75c7dcba90b556eda3798d82f7469..18832b8e505c6416e3c5737decb1f03aa02bd90f 100644 (file)
@@ -260,8 +260,8 @@ class DBStructure
        public static function update($basePath, $verbose, $action, $install = false, array $tables = null, array $definition = null)
        {
                if ($action && !$install) {
-                       Config::set('system', 'maintenance', 1);
-                       Config::set('system', 'maintenance_reason', DI::l10n()->t('%s: Database update', DateTimeFormat::utcNow() . ' ' . date('e')));
+                       DI::config()->set('system', 'maintenance', 1);
+                       DI::config()->set('system', 'maintenance_reason', DI::l10n()->t('%s: Database update', DateTimeFormat::utcNow() . ' ' . date('e')));
                }
 
                $errors = '';
@@ -522,7 +522,7 @@ class DBStructure
 
                                if ($action) {
                                        if (!$install) {
-                                               Config::set('system', 'maintenance_reason', DI::l10n()->t('%s: updating %s table.', DateTimeFormat::utcNow() . ' ' . date('e'), $name));
+                                               DI::config()->set('system', 'maintenance_reason', DI::l10n()->t('%s: updating %s table.', DateTimeFormat::utcNow() . ' ' . date('e'), $name));
                                        }
 
                                        // Ensure index conversion to unique removes duplicates
@@ -574,13 +574,13 @@ class DBStructure
                }
 
                if ($action && !$install) {
-                       Config::set('system', 'maintenance', 0);
-                       Config::set('system', 'maintenance_reason', '');
+                       DI::config()->set('system', 'maintenance', 0);
+                       DI::config()->set('system', 'maintenance_reason', '');
 
                        if ($errors) {
-                               Config::set('system', 'dbupdate', self::UPDATE_FAILED);
+                               DI::config()->set('system', 'dbupdate', self::UPDATE_FAILED);
                        } else {
-                               Config::set('system', 'dbupdate', self::UPDATE_SUCCESSFUL);
+                               DI::config()->set('system', 'dbupdate', self::UPDATE_SUCCESSFUL);
                        }
                }
 
index ae6dd7605ccfdda7d49304e37cda0174bf7b90f6..863e823a1389d723e1234011dd68d0c0850f6fa6 100644 (file)
@@ -67,7 +67,7 @@ class PostUpdate
                if (!$end_id) {
                        $r = q("SELECT `id` FROM `item` WHERE `uid` != 0 ORDER BY `id` DESC LIMIT 1");
                        if ($r) {
-                               Config::set("system", "post_update_1194_end", $r[0]["id"]);
+                               DI::config()->set("system", "post_update_1194_end", $r[0]["id"]);
                                $end_id = DI::config()->get("system", "post_update_1194_end");
                        }
                }
@@ -90,11 +90,11 @@ class PostUpdate
                        intval($start_id), intval($end_id),
                        DBA::escape(Protocol::DFRN), DBA::escape(Protocol::DIASPORA), DBA::escape(Protocol::OSTATUS));
                if (!$r) {
-                       Config::set("system", "post_update_version", 1194);
+                       DI::config()->set("system", "post_update_version", 1194);
                        Logger::log("Update is done", Logger::DEBUG);
                        return true;
                } else {
-                       Config::set("system", "post_update_1194_start", $r[0]["id"]);
+                       DI::config()->set("system", "post_update_1194_start", $r[0]["id"]);
                        $start_id = DI::config()->get("system", "post_update_1194_start");
                }
 
@@ -147,7 +147,7 @@ class PostUpdate
                        }
                }
 
-               Config::set("system", "post_update_version", 1206);
+               DI::config()->set("system", "post_update_version", 1206);
                Logger::log("Done", Logger::DEBUG);
                return true;
        }
@@ -235,7 +235,7 @@ class PostUpdate
                }
                DBA::close($items);
 
-               Config::set("system", "post_update_version_1279_id", $id);
+               DI::config()->set("system", "post_update_version_1279_id", $id);
 
                Logger::log("Processed rows: " . $rows . " - last processed item:  " . $id, Logger::DEBUG);
 
@@ -254,7 +254,7 @@ class PostUpdate
                                DBA::update('item', $fields, $condition);
                        }
 
-                       Config::set("system", "post_update_version", 1279);
+                       DI::config()->set("system", "post_update_version", 1279);
                        Logger::log("Done", Logger::DEBUG);
                        return true;
                }
@@ -369,7 +369,7 @@ class PostUpdate
                }
                DBA::close($items);
 
-               Config::set("system", "post_update_version_1281_id", $id);
+               DI::config()->set("system", "post_update_version_1281_id", $id);
 
                Logger::log("Processed rows: " . $rows . " - last processed item:  " . $id, Logger::DEBUG);
 
@@ -380,7 +380,7 @@ class PostUpdate
                        Logger::log("Updating item-uri in item-content", Logger::DEBUG);
                        DBA::e("UPDATE `item-content` INNER JOIN `item-uri` ON `item-uri`.`uri` = `item-content`.`uri` SET `item-content`.`uri-id` = `item-uri`.`id` WHERE `item-content`.`uri-id` IS NULL");
 
-                       Config::set("system", "post_update_version", 1281);
+                       DI::config()->set("system", "post_update_version", 1281);
                        Logger::log("Done", Logger::DEBUG);
                        return true;
                }
@@ -417,7 +417,7 @@ class PostUpdate
 
                Logger::info('Processed rows: ' . DBA::affectedRows());
 
-               Config::set('system', 'post_update_version', 1297);
+               DI::config()->set('system', 'post_update_version', 1297);
 
                Logger::info('Done');
 
@@ -451,7 +451,7 @@ class PostUpdate
                }
 
                DBA::close($contact);
-               Config::set('system', 'post_update_version', 1322);
+               DI::config()->set('system', 'post_update_version', 1322);
 
                Logger::info('Done');
 
@@ -495,12 +495,12 @@ class PostUpdate
                }
                DBA::close($items);
 
-               Config::set('system', 'post_update_version_1329_id', $id);
+               DI::config()->set('system', 'post_update_version_1329_id', $id);
 
                Logger::info('Processed', ['rows' => $rows, 'last' => $id]);
 
                if ($start_id == $id) {
-                       Config::set('system', 'post_update_version', 1329);
+                       DI::config()->set('system', 'post_update_version', 1329);
                        Logger::info('Done');
                        return true;
                }
index 97d679b7e4fc28c7f36a47dba5713c9515c4ac07..7bb9efaffcbeb5ee9004ac0e42587c3209f3b7b7 100644 (file)
@@ -1429,6 +1429,6 @@ class GServer
                        }
                }
 
-               Config::set('poco', 'last_federation_discovery', time());
+               DI::config()->set('poco', 'last_federation_discovery', time());
        }
 }
index d6c3daf839310a027bd6cfe190a5396d61439025..652439efccdf2f2d15c233056a8660cad86181b9 100644 (file)
@@ -27,7 +27,7 @@ class Server extends BaseAdminModule
                                'domain' => Strings::escapeTags(trim($_POST['newentry_domain'])),
                                'reason' => Strings::escapeTags(trim($_POST['newentry_reason']))
                        ];
-                       Config::set('system', 'blocklist', $blocklist);
+                       DI::config()->set('system', 'blocklist', $blocklist);
                        info(DI::l10n()->t('Server domain pattern added to blocklist.') . EOL);
                } else {
                        // Edit the entries from blocklist
@@ -43,7 +43,7 @@ class Server extends BaseAdminModule
                                        ];
                                }
                        }
-                       Config::set('system', 'blocklist', $blocklist);
+                       DI::config()->set('system', 'blocklist', $blocklist);
                        info(DI::l10n()->t('Site blocklist updated.') . EOL);
                }
 
index cfa6f8d83a49d8688fafdd2fce0fe1fbf37fa0ff..e4382319c95ce2f766bdd6bcf67685e971f91483 100644 (file)
@@ -24,10 +24,10 @@ class DBSync extends BaseAdminModule
                        // @TODO: Replace with parameter from router
                        $update = intval($a->argv[3]);
                        if ($update) {
-                               Config::set('database', 'update_' . $update, 'success');
+                               DI::config()->set('database', 'update_' . $update, 'success');
                                $curr = DI::config()->get('system', 'build');
                                if (intval($curr) == $update) {
-                                       Config::set('system', 'build', intval($curr) + 1);
+                                       DI::config()->set('system', 'build', intval($curr) + 1);
                                }
                                info(DI::l10n()->t('Update has been marked successful') . EOL);
                        }
@@ -40,8 +40,8 @@ class DBSync extends BaseAdminModule
                                $retval = DBStructure::update($a->getBasePath(), false, true);
                                if ($retval === '') {
                                        $o .= DI::l10n()->t("Database structure update %s was successfully applied.", DB_UPDATE_VERSION) . "<br />";
-                                       Config::set('database', 'last_successful_update', DB_UPDATE_VERSION);
-                                       Config::set('database', 'last_successful_update_time', time());
+                                       DI::config()->set('database', 'last_successful_update', DB_UPDATE_VERSION);
+                                       DI::config()->set('database', 'last_successful_update_time', time());
                                } else {
                                        $o .= DI::l10n()->t("Executing of database structure update %s failed with error: %s", DB_UPDATE_VERSION, $retval) . "<br />";
                                }
@@ -63,13 +63,13 @@ class DBSync extends BaseAdminModule
                                                $o .= DI::l10n()->t("Executing %s failed with error: %s", $func, $retval);
                                        } elseif ($retval === Update::SUCCESS) {
                                                $o .= DI::l10n()->t('Update %s was successfully applied.', $func);
-                                               Config::set('database', $func, 'success');
+                                               DI::config()->set('database', $func, 'success');
                                        } else {
                                                $o .= DI::l10n()->t('Update %s did not return a status. Unknown if it succeeded.', $func);
                                        }
                                } else {
                                        $o .= DI::l10n()->t('There was no additional update function %s that needed to be called.', $func) . "<br />";
-                                       Config::set('database', $func, 'success');
+                                       DI::config()->set('database', $func, 'success');
                                }
 
                                return $o;
index 374fd98f214ae416d1dcf006f1d5f41e4642ef58..79d6e43f5e5d5e74968f28ec8c6e84965e268b01 100644 (file)
@@ -29,10 +29,10 @@ class Features extends BaseAdminModule
                                } else {
                                        $val = 0;
                                }
-                               Config::set('feature', $feature, $val);
+                               DI::config()->set('feature', $feature, $val);
 
                                if (!empty($_POST[$featurelock])) {
-                                       Config::set('feature_lock', $feature, $val);
+                                       DI::config()->set('feature_lock', $feature, $val);
                                } else {
                                        Config::delete('feature_lock', $feature);
                                }
index 98bb9b301a9a46a3c1a42577784d1d99dbd94d18..b4c1864ff6892428b404980d5c0d4b871f85f3b3 100644 (file)
@@ -28,9 +28,9 @@ class Settings extends BaseAdminModule
                                return;
                        }
 
-                       Config::set('system', 'logfile', $logfile);
-                       Config::set('system', 'debugging', $debugging);
-                       Config::set('system', 'loglevel', $loglevel);
+                       DI::config()->set('system', 'logfile', $logfile);
+                       DI::config()->set('system', 'debugging', $debugging);
+                       DI::config()->set('system', 'loglevel', $loglevel);
                }
 
                info(DI::l10n()->t("Log settings updated."));
index 88c62486bb1d6a58c70b25346c3b3e236a37c39e..915eaa5046a5b98c0c5617d23065fad40ae3ca60 100644 (file)
@@ -93,7 +93,7 @@ class Site extends BaseAdminModule
                        update_table($a, "gcontact", ['connect', 'addr'], $old_host, $new_host);
 
                        // update config
-                       Config::set('system', 'url', $new_url);
+                       DI::config()->set('system', 'url', $new_url);
                        DI::baseUrl()->saveByURL($new_url);
 
                        // send relocate
@@ -232,7 +232,7 @@ class Site extends BaseAdminModule
 
                // Has the directory url changed? If yes, then resubmit the existing profiles there
                if ($global_directory != DI::config()->get('system', 'directory') && ($global_directory != '')) {
-                       Config::set('system', 'directory', $global_directory);
+                       DI::config()->set('system', 'directory', $global_directory);
                        Worker::add(PRIORITY_LOW, 'Directory');
                }
 
@@ -278,129 +278,129 @@ class Site extends BaseAdminModule
                                );
                        }
                }
-               Config::set('system', 'ssl_policy'            , $ssl_policy);
-               Config::set('system', 'maxloadavg'            , $maxloadavg);
-               Config::set('system', 'maxloadavg_frontend'   , $maxloadavg_frontend);
-               Config::set('system', 'min_memory'            , $min_memory);
-               Config::set('system', 'optimize_max_tablesize', $optimize_max_tablesize);
-               Config::set('system', 'optimize_fragmentation', $optimize_fragmentation);
-               Config::set('system', 'poco_completion'       , $poco_completion);
-               Config::set('system', 'poco_requery_days'     , $poco_requery_days);
-               Config::set('system', 'poco_discovery'        , $poco_discovery);
-               Config::set('system', 'poco_discovery_since'  , $poco_discovery_since);
-               Config::set('system', 'poco_local_search'     , $poco_local_search);
-               Config::set('system', 'nodeinfo'              , $nodeinfo);
-               Config::set('config', 'sitename'              , $sitename);
-               Config::set('config', 'sender_email'          , $sender_email);
-               Config::set('system', 'suppress_tags'         , $suppress_tags);
-               Config::set('system', 'shortcut_icon'         , $shortcut_icon);
-               Config::set('system', 'touch_icon'            , $touch_icon);
+               DI::config()->set('system', 'ssl_policy'            , $ssl_policy);
+               DI::config()->set('system', 'maxloadavg'            , $maxloadavg);
+               DI::config()->set('system', 'maxloadavg_frontend'   , $maxloadavg_frontend);
+               DI::config()->set('system', 'min_memory'            , $min_memory);
+               DI::config()->set('system', 'optimize_max_tablesize', $optimize_max_tablesize);
+               DI::config()->set('system', 'optimize_fragmentation', $optimize_fragmentation);
+               DI::config()->set('system', 'poco_completion'       , $poco_completion);
+               DI::config()->set('system', 'poco_requery_days'     , $poco_requery_days);
+               DI::config()->set('system', 'poco_discovery'        , $poco_discovery);
+               DI::config()->set('system', 'poco_discovery_since'  , $poco_discovery_since);
+               DI::config()->set('system', 'poco_local_search'     , $poco_local_search);
+               DI::config()->set('system', 'nodeinfo'              , $nodeinfo);
+               DI::config()->set('config', 'sitename'              , $sitename);
+               DI::config()->set('config', 'sender_email'          , $sender_email);
+               DI::config()->set('system', 'suppress_tags'         , $suppress_tags);
+               DI::config()->set('system', 'shortcut_icon'         , $shortcut_icon);
+               DI::config()->set('system', 'touch_icon'            , $touch_icon);
 
                if ($banner == "") {
                        Config::delete('system', 'banner');
                } else {
-                       Config::set('system', 'banner', $banner);
+                       DI::config()->set('system', 'banner', $banner);
                }
 
                if (empty($additional_info)) {
                        Config::delete('config', 'info');
                } else {
-                       Config::set('config', 'info', $additional_info);
+                       DI::config()->set('config', 'info', $additional_info);
                }
-               Config::set('system', 'language', $language);
-               Config::set('system', 'theme', $theme);
+               DI::config()->set('system', 'language', $language);
+               DI::config()->set('system', 'theme', $theme);
                Theme::install($theme);
 
                if ($theme_mobile == '---') {
                        Config::delete('system', 'mobile-theme');
                } else {
-                       Config::set('system', 'mobile-theme', $theme_mobile);
+                       DI::config()->set('system', 'mobile-theme', $theme_mobile);
                }
                if ($singleuser == '---') {
                        Config::delete('system', 'singleuser');
                } else {
-                       Config::set('system', 'singleuser', $singleuser);
+                       DI::config()->set('system', 'singleuser', $singleuser);
                }
-               Config::set('system', 'maximagesize'           , $maximagesize);
-               Config::set('system', 'max_image_length'       , $maximagelength);
-               Config::set('system', 'jpeg_quality'           , $jpegimagequality);
-
-               Config::set('config', 'register_policy'        , $register_policy);
-               Config::set('system', 'max_daily_registrations', $daily_registrations);
-               Config::set('system', 'account_abandon_days'   , $abandon_days);
-               Config::set('config', 'register_text'          , $register_text);
-               Config::set('system', 'allowed_sites'          , $allowed_sites);
-               Config::set('system', 'allowed_email'          , $allowed_email);
-               Config::set('system', 'forbidden_nicknames'    , $forbidden_nicknames);
-               Config::set('system', 'no_oembed_rich_content' , $no_oembed_rich_content);
-               Config::set('system', 'allowed_oembed'         , $allowed_oembed);
-               Config::set('system', 'block_public'           , $block_public);
-               Config::set('system', 'publish_all'            , $force_publish);
-               Config::set('system', 'newuser_private'        , $newuser_private);
-               Config::set('system', 'enotify_no_content'     , $enotify_no_content);
-               Config::set('system', 'disable_embedded'       , $disable_embedded);
-               Config::set('system', 'allow_users_remote_self', $allow_users_remote_self);
-               Config::set('system', 'explicit_content'       , $explicit_content);
-               Config::set('system', 'check_new_version_url'  , $check_new_version_url);
-
-               Config::set('system', 'block_extended_register', $no_multi_reg);
-               Config::set('system', 'no_openid'              , $no_openid);
-               Config::set('system', 'no_regfullname'         , $no_regfullname);
-               Config::set('system', 'community_page_style'   , $community_page_style);
-               Config::set('system', 'max_author_posts_community_page', $max_author_posts_community_page);
-               Config::set('system', 'verifyssl'              , $verifyssl);
-               Config::set('system', 'proxyuser'              , $proxyuser);
-               Config::set('system', 'proxy'                  , $proxy);
-               Config::set('system', 'curl_timeout'           , $timeout);
-               Config::set('system', 'dfrn_only'              , $dfrn_only);
-               Config::set('system', 'ostatus_disabled'       , $ostatus_disabled);
-               Config::set('system', 'diaspora_enabled'       , $diaspora_enabled);
-
-               Config::set('config', 'private_addons'         , $private_addons);
-
-               Config::set('system', 'force_ssl'              , $force_ssl);
-               Config::set('system', 'hide_help'              , $hide_help);
-
-               Config::set('system', 'dbclean'                , $dbclean);
-               Config::set('system', 'dbclean-expire-days'    , $dbclean_expire_days);
-               Config::set('system', 'dbclean_expire_conversation', $dbclean_expire_conv);
+               DI::config()->set('system', 'maximagesize'           , $maximagesize);
+               DI::config()->set('system', 'max_image_length'       , $maximagelength);
+               DI::config()->set('system', 'jpeg_quality'           , $jpegimagequality);
+
+               DI::config()->set('config', 'register_policy'        , $register_policy);
+               DI::config()->set('system', 'max_daily_registrations', $daily_registrations);
+               DI::config()->set('system', 'account_abandon_days'   , $abandon_days);
+               DI::config()->set('config', 'register_text'          , $register_text);
+               DI::config()->set('system', 'allowed_sites'          , $allowed_sites);
+               DI::config()->set('system', 'allowed_email'          , $allowed_email);
+               DI::config()->set('system', 'forbidden_nicknames'    , $forbidden_nicknames);
+               DI::config()->set('system', 'no_oembed_rich_content' , $no_oembed_rich_content);
+               DI::config()->set('system', 'allowed_oembed'         , $allowed_oembed);
+               DI::config()->set('system', 'block_public'           , $block_public);
+               DI::config()->set('system', 'publish_all'            , $force_publish);
+               DI::config()->set('system', 'newuser_private'        , $newuser_private);
+               DI::config()->set('system', 'enotify_no_content'     , $enotify_no_content);
+               DI::config()->set('system', 'disable_embedded'       , $disable_embedded);
+               DI::config()->set('system', 'allow_users_remote_self', $allow_users_remote_self);
+               DI::config()->set('system', 'explicit_content'       , $explicit_content);
+               DI::config()->set('system', 'check_new_version_url'  , $check_new_version_url);
+
+               DI::config()->set('system', 'block_extended_register', $no_multi_reg);
+               DI::config()->set('system', 'no_openid'              , $no_openid);
+               DI::config()->set('system', 'no_regfullname'         , $no_regfullname);
+               DI::config()->set('system', 'community_page_style'   , $community_page_style);
+               DI::config()->set('system', 'max_author_posts_community_page', $max_author_posts_community_page);
+               DI::config()->set('system', 'verifyssl'              , $verifyssl);
+               DI::config()->set('system', 'proxyuser'              , $proxyuser);
+               DI::config()->set('system', 'proxy'                  , $proxy);
+               DI::config()->set('system', 'curl_timeout'           , $timeout);
+               DI::config()->set('system', 'dfrn_only'              , $dfrn_only);
+               DI::config()->set('system', 'ostatus_disabled'       , $ostatus_disabled);
+               DI::config()->set('system', 'diaspora_enabled'       , $diaspora_enabled);
+
+               DI::config()->set('config', 'private_addons'         , $private_addons);
+
+               DI::config()->set('system', 'force_ssl'              , $force_ssl);
+               DI::config()->set('system', 'hide_help'              , $hide_help);
+
+               DI::config()->set('system', 'dbclean'                , $dbclean);
+               DI::config()->set('system', 'dbclean-expire-days'    , $dbclean_expire_days);
+               DI::config()->set('system', 'dbclean_expire_conversation', $dbclean_expire_conv);
 
                if ($dbclean_unclaimed == 0) {
                        $dbclean_unclaimed = $dbclean_expire_days;
                }
 
-               Config::set('system', 'dbclean-expire-unclaimed', $dbclean_unclaimed);
+               DI::config()->set('system', 'dbclean-expire-unclaimed', $dbclean_unclaimed);
 
                if ($itemcache != '') {
                        $itemcache = BasePath::getRealPath($itemcache);
                }
 
-               Config::set('system', 'itemcache', $itemcache);
-               Config::set('system', 'itemcache_duration', $itemcache_duration);
-               Config::set('system', 'max_comments', $max_comments);
+               DI::config()->set('system', 'itemcache', $itemcache);
+               DI::config()->set('system', 'itemcache_duration', $itemcache_duration);
+               DI::config()->set('system', 'max_comments', $max_comments);
 
                if ($temppath != '') {
                        $temppath = BasePath::getRealPath($temppath);
                }
 
-               Config::set('system', 'temppath', $temppath);
+               DI::config()->set('system', 'temppath', $temppath);
 
-               Config::set('system', 'proxy_disabled'   , $proxy_disabled);
-               Config::set('system', 'only_tag_search'  , $only_tag_search);
+               DI::config()->set('system', 'proxy_disabled'   , $proxy_disabled);
+               DI::config()->set('system', 'only_tag_search'  , $only_tag_search);
 
-               Config::set('system', 'worker_queues'    , $worker_queues);
-               Config::set('system', 'worker_dont_fork' , $worker_dont_fork);
-               Config::set('system', 'worker_fastlane'  , $worker_fastlane);
-               Config::set('system', 'frontend_worker'  , $worker_frontend);
+               DI::config()->set('system', 'worker_queues'    , $worker_queues);
+               DI::config()->set('system', 'worker_dont_fork' , $worker_dont_fork);
+               DI::config()->set('system', 'worker_fastlane'  , $worker_fastlane);
+               DI::config()->set('system', 'frontend_worker'  , $worker_frontend);
 
-               Config::set('system', 'relay_directly'   , $relay_directly);
-               Config::set('system', 'relay_server'     , $relay_server);
-               Config::set('system', 'relay_subscribe'  , $relay_subscribe);
-               Config::set('system', 'relay_scope'      , $relay_scope);
-               Config::set('system', 'relay_server_tags', $relay_server_tags);
-               Config::set('system', 'relay_user_tags'  , $relay_user_tags);
+               DI::config()->set('system', 'relay_directly'   , $relay_directly);
+               DI::config()->set('system', 'relay_server'     , $relay_server);
+               DI::config()->set('system', 'relay_subscribe'  , $relay_subscribe);
+               DI::config()->set('system', 'relay_scope'      , $relay_scope);
+               DI::config()->set('system', 'relay_server_tags', $relay_server_tags);
+               DI::config()->set('system', 'relay_user_tags'  , $relay_user_tags);
 
-               Config::set('system', 'rino_encrypt'     , $rino);
+               DI::config()->set('system', 'rino_encrypt'     , $rino);
 
                info(DI::l10n()->t('Site settings updated.') . EOL);
 
@@ -416,7 +416,7 @@ class Site extends BaseAdminModule
 
                if (strlen(DI::config()->get('system', 'directory_submit_url')) &&
                        !strlen(DI::config()->get('system', 'directory'))) {
-                       Config::set('system', 'directory', dirname(DI::config()->get('system', 'directory_submit_url')));
+                       DI::config()->set('system', 'directory', dirname(DI::config()->get('system', 'directory_submit_url')));
                        Config::delete('system', 'directory_submit_url');
                }
 
index a8b037d5d3fcd7a84cf0d3d6a18040fe7f462ae9..c74f877268d5ba1c193e190a1e0a558bf613c02b 100644 (file)
@@ -115,7 +115,7 @@ class Summary extends BaseAdminModule
                $confBasepath = $configCache->get('system', 'basepath');
                $currBasepath = DI::config()->get('system', 'basepath');
                if ($confBasepath !== $currBasepath || !is_dir($currBasepath)) {
-                       if (is_dir($confBasepath) && Config::set('system', 'basepath', $confBasepath)) {
+                       if (is_dir($confBasepath) && DI::config()->set('system', 'basepath', $confBasepath)) {
                                DI::logger()->info('Friendica\'s system.basepath was updated successfully.', [
                                        'from' => $currBasepath,
                                        'to'   => $confBasepath,
index 000dedd051a0af7145fe069d076364e48f04b98d..aa819fe41a87f2c9ff2f4fbfca65023450f935b9 100644 (file)
@@ -23,9 +23,9 @@ class Tos extends BaseAdminModule
                $displayprivstatement = !empty($_POST['displayprivstatement']);
                $tostext = (!empty($_POST['tostext']) ? strip_tags(trim($_POST['tostext'])) : '');
 
-               Config::set('system', 'tosdisplay', $displaytos);
-               Config::set('system', 'tosprivstatement', $displayprivstatement);
-               Config::set('system', 'tostext', $tostext);
+               DI::config()->set('system', 'tosdisplay', $displaytos);
+               DI::config()->set('system', 'tosprivstatement', $displayprivstatement);
+               DI::config()->set('system', 'tostext', $tostext);
 
                info(DI::l10n()->t('The Terms of Service settings have been updated.'));
 
index 00e0df5f42cef48b2414cb1e18bfbdd557bf6c55..fe362839f3419c8ce328f44f1e9f01ef9f4f7ef2 100644 (file)
@@ -492,8 +492,8 @@ class DFRN
                $pubkey = DI::config()->get('system', 'site_pubkey');
                if (! $pubkey) {
                        $res = Crypto::newKeypair(1024);
-                       Config::set('system', 'site_prvkey', $res['prvkey']);
-                       Config::set('system', 'site_pubkey', $res['pubkey']);
+                       DI::config()->set('system', 'site_prvkey', $res['prvkey']);
+                       DI::config()->set('system', 'site_pubkey', $res['pubkey']);
                }
 
                $rp = q(
index b6fdd7f0262e86b63c5bbd2de898546b5ffbf9de..a25651523cf176ff0282d2733d8c3310d516da7d 100644 (file)
@@ -43,7 +43,7 @@ class CheckVersion
                $gitversion = DBA::escape(trim(Network::fetchUrl($checked_url)));
                Logger::log("Upstream VERSION is: ".$gitversion, Logger::DEBUG);
 
-               Config::set('system', 'git_friendica_version', $gitversion);
+               DI::config()->set('system', 'git_friendica_version', $gitversion);
 
                Logger::log('checkversion: end');
 
index 7a59d64ffb9b9092b14bc0bed336297e8bd1c635..559085be24a1a48f12e2e2d2fafc35b2aaa7a593 100644 (file)
@@ -86,7 +86,7 @@ class Cron
 
                        self::checkdeletedContacts();
 
-                       Config::set('system', 'last_expire_day', $d2);
+                       DI::config()->set('system', 'last_expire_day', $d2);
                }
 
                // Hourly cron calls
@@ -100,7 +100,7 @@ class Cron
                                DBA::e("OPTIMIZE TABLE `workerqueue`");
                        }
 
-                       Config::set('system', 'last_cron_hourly', time());
+                       DI::config()->set('system', 'last_cron_hourly', time());
                }
 
                // Ensure to have a .htaccess file.
@@ -118,7 +118,7 @@ class Cron
 
                Logger::log('cron: end');
 
-               Config::set('system', 'last_cron', time());
+               DI::config()->set('system', 'last_cron', time());
 
                return;
        }
index 5487b35d6725d35597e8ecb566350d9907a4f20d..48b4923c76abfd0fff2673def260284c1f08d901 100644 (file)
@@ -226,7 +226,7 @@ class CronJobs
                        }
                }
 
-               Config::set('system', 'cache_last_cleared', time());
+               DI::config()->set('system', 'cache_last_cleared', time());
        }
 
        /**
index 11e73c24a20790a8291122b67ca92d5f5cfc96c3..60f0e64c427c2da4ad669cfab7af73556cc5c3b3 100644 (file)
@@ -98,7 +98,7 @@ class DBClean {
                        DBA::close($r);
                        Logger::log("Done deleting ".$count." old global item entries from item table without user copy. Last ID: ".$last_id);
 
-                       Config::set('system', 'dbclean-last-id-1', $last_id);
+                       DI::config()->set('system', 'dbclean-last-id-1', $last_id);
                } elseif ($stage == 2) {
                        $last_id = DI::config()->get('system', 'dbclean-last-id-2', 0);
 
@@ -120,10 +120,10 @@ class DBClean {
                        DBA::close($r);
                        Logger::log("Done deleting ".$count." items without parents. Last ID: ".$last_id);
 
-                       Config::set('system', 'dbclean-last-id-2', $last_id);
+                       DI::config()->set('system', 'dbclean-last-id-2', $last_id);
 
                        if ($count < $limit) {
-                               Config::set('system', 'finished-dbclean-2', true);
+                               DI::config()->set('system', 'finished-dbclean-2', true);
                        }
                } elseif ($stage == 3) {
                        $last_id = DI::config()->get('system', 'dbclean-last-id-3', 0);
@@ -146,10 +146,10 @@ class DBClean {
                        DBA::close($r);
                        Logger::log("Done deleting ".$count." orphaned data from thread table. Last ID: ".$last_id);
 
-                       Config::set('system', 'dbclean-last-id-3', $last_id);
+                       DI::config()->set('system', 'dbclean-last-id-3', $last_id);
 
                        if ($count < $limit) {
-                               Config::set('system', 'finished-dbclean-3', true);
+                               DI::config()->set('system', 'finished-dbclean-3', true);
                        }
                } elseif ($stage == 4) {
                        $last_id = DI::config()->get('system', 'dbclean-last-id-4', 0);
@@ -172,10 +172,10 @@ class DBClean {
                        DBA::close($r);
                        Logger::log("Done deleting ".$count." orphaned data from notify table. Last ID: ".$last_id);
 
-                       Config::set('system', 'dbclean-last-id-4', $last_id);
+                       DI::config()->set('system', 'dbclean-last-id-4', $last_id);
 
                        if ($count < $limit) {
-                               Config::set('system', 'finished-dbclean-4', true);
+                               DI::config()->set('system', 'finished-dbclean-4', true);
                        }
                } elseif ($stage == 5) {
                        $last_id = DI::config()->get('system', 'dbclean-last-id-5', 0);
@@ -198,10 +198,10 @@ class DBClean {
                        DBA::close($r);
                        Logger::log("Done deleting ".$count." orphaned data from notify-threads table. Last ID: ".$last_id);
 
-                       Config::set('system', 'dbclean-last-id-5', $last_id);
+                       DI::config()->set('system', 'dbclean-last-id-5', $last_id);
 
                        if ($count < $limit) {
-                               Config::set('system', 'finished-dbclean-5', true);
+                               DI::config()->set('system', 'finished-dbclean-5', true);
                        }
                } elseif ($stage == 6) {
                        $last_id = DI::config()->get('system', 'dbclean-last-id-6', 0);
@@ -224,10 +224,10 @@ class DBClean {
                        DBA::close($r);
                        Logger::log("Done deleting ".$count." orphaned data from sign table. Last ID: ".$last_id);
 
-                       Config::set('system', 'dbclean-last-id-6', $last_id);
+                       DI::config()->set('system', 'dbclean-last-id-6', $last_id);
 
                        if ($count < $limit) {
-                               Config::set('system', 'finished-dbclean-6', true);
+                               DI::config()->set('system', 'finished-dbclean-6', true);
                        }
                } elseif ($stage == 7) {
                        $last_id = DI::config()->get('system', 'dbclean-last-id-7', 0);
@@ -250,10 +250,10 @@ class DBClean {
                        DBA::close($r);
                        Logger::log("Done deleting ".$count." orphaned data from term table. Last ID: ".$last_id);
 
-                       Config::set('system', 'dbclean-last-id-7', $last_id);
+                       DI::config()->set('system', 'dbclean-last-id-7', $last_id);
 
                        if ($count < $limit) {
-                               Config::set('system', 'finished-dbclean-7', true);
+                               DI::config()->set('system', 'finished-dbclean-7', true);
                        }
                } elseif ($stage == 8) {
                        if ($days <= 0) {
@@ -289,7 +289,7 @@ class DBClean {
                        DBA::close($r);
                        Logger::log("Done deleting ".$count." expired threads. Last ID: ".$last_id);
 
-                       Config::set('system', 'dbclean-last-id-8', $last_id);
+                       DI::config()->set('system', 'dbclean-last-id-8', $last_id);
                } elseif ($stage == 9) {
                        if ($days <= 0) {
                                return;
@@ -317,7 +317,7 @@ class DBClean {
                        DBA::close($r);
                        Logger::log("Done deleting ".$count." old global item entries from expired threads. Last ID: ".$last_id);
 
-                       Config::set('system', 'dbclean-last-id-9', $last_id);
+                       DI::config()->set('system', 'dbclean-last-id-9', $last_id);
                } elseif ($stage == 10) {
                        $last_id = DI::config()->get('system', 'dbclean-last-id-10', 0);
                        $days = intval(DI::config()->get('system', 'dbclean_expire_conversation', 90));
@@ -340,7 +340,7 @@ class DBClean {
                        DBA::close($r);
                        Logger::log("Done deleting ".$count." conversations. Last created: ".$last_id);
 
-                       Config::set('system', 'dbclean-last-id-10', $last_id);
+                       DI::config()->set('system', 'dbclean-last-id-10', $last_id);
                }
        }
 }
index 15d438b67997c15f9ff62eda335577f96ef61315..60008d0db0510982b8cefd0107e7e70d1513b028 100644 (file)
@@ -21,11 +21,11 @@ class DBATest extends DatabaseTest
                DI::init($dice);
 
                // Default config
-               Config::set('config', 'hostname', 'localhost');
-               Config::set('system', 'throttle_limit_day', 100);
-               Config::set('system', 'throttle_limit_week', 100);
-               Config::set('system', 'throttle_limit_month', 100);
-               Config::set('system', 'theme', 'system_theme');
+               DI::config()->set('config', 'hostname', 'localhost');
+               DI::config()->set('system', 'throttle_limit_day', 100);
+               DI::config()->set('system', 'throttle_limit_week', 100);
+               DI::config()->set('system', 'throttle_limit_month', 100);
+               DI::config()->set('system', 'theme', 'system_theme');
        }
 
        /**
index d8591ec5235323d99399f75dc7af249004b55433..a40d19785c03fe74fd580f82dd5907c1c9382e69 100644 (file)
@@ -65,7 +65,7 @@ function update_1178()
 function update_1179()
 {
        if (DI::config()->get('system', 'no_community_page')) {
-               Config::set('system', 'community_page_style', CP_NO_COMMUNITY_PAGE);
+               DI::config()->set('system', 'community_page_style', CP_NO_COMMUNITY_PAGE);
        }
 
        // Update the central item storage with uid=0
@@ -88,7 +88,7 @@ function update_1189()
 
        if (strlen(DI::config()->get('system', 'directory_submit_url')) &&
                !strlen(DI::config()->get('system', 'directory'))) {
-               Config::set('system', 'directory', dirname(DI::config()->get('system', 'directory_submit_url')));
+               DI::config()->set('system', 'directory', dirname(DI::config()->get('system', 'directory_submit_url')));
                Config::delete('system', 'directory_submit_url');
        }
 
@@ -97,7 +97,7 @@ function update_1189()
 
 function update_1191()
 {
-       Config::set('system', 'maintenance', 1);
+       DI::config()->set('system', 'maintenance', 1);
 
        if (Addon::isEnabled('forumlist')) {
                $addon = 'forumlist';
@@ -114,7 +114,7 @@ function update_1191()
                                // since Addon::uninstall() don't work here
                                q("DELETE FROM `addon` WHERE `name` = 'forumlist' ");
                                q("DELETE FROM `hook` WHERE `file` = 'addon/forumlist/forumlist.php' ");
-                               Config::set('system', 'addon', implode(", ", $addons_arr));
+                               DI::config()->set('system', 'addon', implode(", ", $addons_arr));
                        }
                }
        }
@@ -154,7 +154,7 @@ function update_1191()
                }
        }
 
-       Config::set('system', 'maintenance', 0);
+       DI::config()->set('system', 'maintenance', 0);
 
        return Update::SUCCESS;
 }
@@ -193,7 +193,7 @@ function update_1245()
                return Update::SUCCESS;
        }
 
-       Config::set('system', 'rino_encrypt', 1);
+       DI::config()->set('system', 'rino_encrypt', 1);
 
        return Update::SUCCESS;
 }
@@ -210,8 +210,8 @@ WHERE `hook` LIKE 'plugin_%'");
 
 function update_1260()
 {
-       Config::set('system', 'maintenance', 1);
-       Config::set(
+       DI::config()->set('system', 'maintenance', 1);
+       DI::config()->set(
                'system',
                'maintenance_reason',
                DI::l10n()->t(
@@ -252,7 +252,7 @@ function update_1260()
        DBA::e("UPDATE `thread` INNER JOIN `item` ON `thread`.`iid` = `item`.`id`
                SET `thread`.`author-id` = `item`.`author-id` WHERE `thread`.`author-id` = 0");
 
-       Config::set('system', 'maintenance', 0);
+       DI::config()->set('system', 'maintenance', 0);
        return Update::SUCCESS;
 }
 
@@ -265,8 +265,8 @@ function update_1261()
 
 function update_1278()
 {
-       Config::set('system', 'maintenance', 1);
-       Config::set(
+       DI::config()->set('system', 'maintenance', 1);
+       DI::config()->set(
                'system',
                'maintenance_reason',
                DI::l10n()->t(
@@ -278,7 +278,7 @@ function update_1278()
        Item::update(['post-type' => Item::PT_PAGE], ['bookmark' => true]);
        Item::update(['post-type' => Item::PT_PERSONAL_NOTE], ['type' => 'note']);
 
-       Config::set('system', 'maintenance', 0);
+       DI::config()->set('system', 'maintenance', 0);
 
        return Update::SUCCESS;
 }
@@ -415,7 +415,7 @@ function update_1330()
        // set the name of the storage instead of the classpath as config
        if (!empty($currStorage)) {
                /** @var Storage\IStorage $currStorage */
-               if (!Config::set('storage', 'name', $currStorage::getName())) {
+               if (!DI::config()->set('storage', 'name', $currStorage::getName())) {
                        return Update::FAILED;
                }
 
index 5629d95c4999a94eb58e81cf71456d58e1ce7044..652cea9574c34735cd63b615c411e550061856dc 100644 (file)
@@ -42,7 +42,7 @@ function theme_admin(App $a)
 function theme_admin_post(App $a)
 {
        if (isset($_POST['duepuntozero-settings-submit'])) {
-               Config::set('duepuntozero', 'colorset', $_POST['duepuntozero_colorset']);
+               DI::config()->set('duepuntozero', 'colorset', $_POST['duepuntozero_colorset']);
        }
 }
 
index 95d9a0e4eca507efe915be1b6df5e02f7868f9c5..2e76ae261cae6f477bb47b6874a348273fce2385 100644 (file)
@@ -34,18 +34,18 @@ function theme_admin_post(App $a)
        }
 
        if (isset($_POST['frio-settings-submit'])) {
-               Config::set('frio', 'scheme',           $_POST['frio_scheme']           ?? '');
-               Config::set('frio', 'nav_bg',           $_POST['frio_nav_bg']           ?? '');
-               Config::set('frio', 'nav_icon_color',   $_POST['frio_nav_icon_color']   ?? '');
-               Config::set('frio', 'link_color',       $_POST['frio_link_color']       ?? '');
-               Config::set('frio', 'background_color', $_POST['frio_background_color'] ?? '');
-               Config::set('frio', 'contentbg_transp', $_POST['frio_contentbg_transp'] ?? '');
-               Config::set('frio', 'background_image', $_POST['frio_background_image'] ?? '');
-               Config::set('frio', 'bg_image_option',  $_POST['frio_bg_image_option']  ?? '');
-               Config::set('frio', 'login_bg_image',   $_POST['frio_login_bg_image']   ?? '');
-               Config::set('frio', 'login_bg_color',   $_POST['frio_login_bg_color']   ?? '');
-               Config::set('frio', 'css_modified',     time());
-               Config::set('frio', 'enable_compose',   $_POST['frio_enable_compose']   ?? 0);
+               DI::config()->set('frio', 'scheme',           $_POST['frio_scheme']           ?? '');
+               DI::config()->set('frio', 'nav_bg',           $_POST['frio_nav_bg']           ?? '');
+               DI::config()->set('frio', 'nav_icon_color',   $_POST['frio_nav_icon_color']   ?? '');
+               DI::config()->set('frio', 'link_color',       $_POST['frio_link_color']       ?? '');
+               DI::config()->set('frio', 'background_color', $_POST['frio_background_color'] ?? '');
+               DI::config()->set('frio', 'contentbg_transp', $_POST['frio_contentbg_transp'] ?? '');
+               DI::config()->set('frio', 'background_image', $_POST['frio_background_image'] ?? '');
+               DI::config()->set('frio', 'bg_image_option',  $_POST['frio_bg_image_option']  ?? '');
+               DI::config()->set('frio', 'login_bg_image',   $_POST['frio_login_bg_image']   ?? '');
+               DI::config()->set('frio', 'login_bg_color',   $_POST['frio_login_bg_color']   ?? '');
+               DI::config()->set('frio', 'css_modified',     time());
+               DI::config()->set('frio', 'enable_compose',   $_POST['frio_enable_compose']   ?? 0);
        }
 }
 
index 51915cfd7c0a48acd18c2e82af3462bd89cdfafa..459a0d7f40cb6d6cd26f2c0493d8008d7f8c67a9 100644 (file)
@@ -45,10 +45,10 @@ function theme_admin(App $a) {
 
 function theme_admin_post(App $a) {
        if (isset($_POST['quattro-settings-submit'])){
-               Config::set('quattro', 'align', $_POST['quattro_align']);
-               Config::set('quattro', 'color', $_POST['quattro_color']);
-               Config::set('quattro', 'tfs', $_POST['quattro_tfs']);
-               Config::set('quattro', 'pfs', $_POST['quattro_pfs']);
+               DI::config()->set('quattro', 'align', $_POST['quattro_align']);
+               DI::config()->set('quattro', 'color', $_POST['quattro_color']);
+               DI::config()->set('quattro', 'tfs', $_POST['quattro_tfs']);
+               DI::config()->set('quattro', 'pfs', $_POST['quattro_pfs']);
        }
 }
 
index 60c33975e2a32cb10a82fd75c0aefafa4d2ea454..2d185be2c88a9fb12b409a2182def05cd1b6de69 100644 (file)
@@ -90,14 +90,14 @@ function theme_admin(App $a) {
 
 function theme_admin_post(App $a) {
        if (isset($_POST['vier-settings-submit'])){
-               Config::set('vier', 'style', $_POST['vier_style']);
-               Config::set('vier', 'show_pages', $_POST['vier_show_pages']);
-               Config::set('vier', 'show_profiles', $_POST['vier_show_profiles']);
-               Config::set('vier', 'show_helpers', $_POST['vier_show_helpers']);
-               Config::set('vier', 'show_services', $_POST['vier_show_services']);
-               Config::set('vier', 'show_friends', $_POST['vier_show_friends']);
-               Config::set('vier', 'show_lastusers', $_POST['vier_show_lastusers']);
-               Config::set('vier', 'helperlist', $_POST['vier_helperlist']);
+               DI::config()->set('vier', 'style', $_POST['vier_style']);
+               DI::config()->set('vier', 'show_pages', $_POST['vier_show_pages']);
+               DI::config()->set('vier', 'show_profiles', $_POST['vier_show_profiles']);
+               DI::config()->set('vier', 'show_helpers', $_POST['vier_show_helpers']);
+               DI::config()->set('vier', 'show_services', $_POST['vier_show_services']);
+               DI::config()->set('vier', 'show_friends', $_POST['vier_show_friends']);
+               DI::config()->set('vier', 'show_lastusers', $_POST['vier_show_lastusers']);
+               DI::config()->set('vier', 'helperlist', $_POST['vier_helperlist']);
        }
 }