]> git.mxchange.org Git - friendica.git/commitdiff
Force "Database" as default storage backend
authorPhilipp <admin@philipp.info>
Tue, 10 Aug 2021 20:53:20 +0000 (22:53 +0200)
committerPhilipp <admin@philipp.info>
Mon, 16 Aug 2021 21:27:42 +0000 (23:27 +0200)
static/settings.config.php
update.php

index e8c6d09f81eef735e58f6304b9c09c75d4b483f9..96ae421ff0e746354c9e72d2b7c004f53dc973a8 100644 (file)
@@ -203,4 +203,11 @@ return [
        // Used in the admin settings to lock certain features
        'featurelock' => [
        ],
+
+       // Storage backend configuration
+       'storage' => [
+               // name (String)
+               // The name of the current used backend (default is Database)
+               'name' => 'Database',
+       ],
 ];
index 842fefca88f9f4bea7d24dd8e1bedfa71a40fccc..5d9c76a994a9313efcbab9e4a3bf9fa16338a231 100644 (file)
@@ -981,3 +981,20 @@ function update_1429()
 
        return Update::SUCCESS;
 }
+
+function update_1433()
+{
+       $name = DI::config()->get('storage', 'name');
+
+       // in case of an empty config, set "Database" as default storage backend
+       if (empty($name)) {
+               DI::config()->set('storage', 'name', Storage\Database::getName());
+       }
+
+       // In case of a Using deprecated storage class value, set the right name for it
+       if (stristr($name, 'Friendica\Model\Storage\\')) {
+               DI::config()->set('storage', 'name', substr($name, 24));
+       }
+
+       return Update::SUCCESS;
+}