]> git.mxchange.org Git - friendica.git/blobdiff - update.php
Fix "Undefined constant Friendica\Content\Conversation::PARCEL_DIASPORA"
[friendica.git] / update.php
index ad33dde01206326415817a49749feab505791815..85a06892f04c99a542545221ceba5bdfa4f0ad07 100644 (file)
@@ -1184,11 +1184,46 @@ function update_1508()
 {
        $config = DBA::selectToArray('config');
 
+       $newConfig = DI::config()->beginTransaction();
+
        foreach ($config as $entry) {
-               DI::config()->set($entry['cat'], $entry['k'], $entry['v'], false);
+               $newConfig->set($entry['cat'], $entry['k'], $entry['v']);
+       }
+
+       $newConfig->commit();
+
+       return Update::SUCCESS;
+}
+
+function update_1509()
+{
+       $addons = DBA::selectToArray('addon');
+
+       $newConfig = DI::config()->beginTransaction();
+
+       foreach ($addons as $addon) {
+               $newConfig->set('addons', $addon['name'], [
+                       'last_update' => $addon['timestamp'],
+                       'admin' => (bool)$addon['plugin_admin'],
+               ]);
        }
 
-       DI::config()->save();
+       $newConfig->commit();
 
-       DBA::e("DELETE FROM `config`");
+       return Update::SUCCESS;
+}
+
+function update_1510()
+{
+       $blocks = DBA::select('pconfig', ['uid', 'v'], ['cat' => 'blockem', 'k' => 'words']);
+       while ($block = DBA::fetch($blocks)) {
+               foreach (explode(',', $block['v']) as $account) {
+                       $id = Contact::getIdForURL(trim($account), 0, false);
+                       if (empty($id)) {
+                               continue;
+                       }
+                       Contact\User::setCollapsed($id, $block['uid'], true);
+               }
+       }
+       return Update::SUCCESS;
 }