X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=update.php;h=85a06892f04c99a542545221ceba5bdfa4f0ad07;hb=6cdafb6b63451b5bd1feb24a5e16c6bad6e059c9;hp=356877ff9b0d2c94a0cbd3e425c508cdccd92de5;hpb=1874a32728142f2c12724562eb122eb1cd1370fe;p=friendica.git diff --git a/update.php b/update.php index 356877ff9b..85a06892f0 100644 --- a/update.php +++ b/update.php @@ -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,51 @@ 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(); + + 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'], + ]); + } + + $newConfig->commit(); + + 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; +}