]> git.mxchange.org Git - friendica.git/blobdiff - update.php
Merge pull request #12606 from nupplaphil/bug/file_put
[friendica.git] / update.php
index 356877ff9b0d2c94a0cbd3e425c508cdccd92de5..1dbf78e06f915647cf6300c4886623fe4ca8fdaa 100644 (file)
@@ -1148,6 +1148,10 @@ function update_1502()
 
 function update_1505()
 {
+       if (!DBStructure::existsTable('config')) {
+               return Update::SUCCESS;
+       }
+
        $conditions = [
                "((`cat`  = ?) AND ((`k` LIKE ?) OR (`k` = ?) OR (`k` LIKE ?) OR (`k` = ?))) OR " .
                "((`cat` != ?) AND  (`k` LIKE ?)) OR " .
@@ -1175,3 +1179,18 @@ function update_1505()
 
        return DBA::delete('config', $conditions) ? Update::SUCCESS : Update::FAILED;
 }
+
+function update_1508()
+{
+       $config = DBA::selectToArray('config');
+
+       $newConfig = DI::config()->beginTransaction();
+
+       foreach ($config as $entry) {
+               $newConfig->set($entry['cat'], $entry['k'], $entry['v']);
+       }
+
+       $newConfig->commit();
+
+       DBA::e("TRUNCATE TABLE `config`");
+}