#!/usr/bin/env php . */ /** * Update User URIs. * * @package GNUsocial * @author Bruno Casteleiro * @copyright 2019 Free Software Foundation, Inc http://www.fsf.org * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later */ define('INSTALLDIR', dirname(__FILE__, 2)); define('PUBLICDIR', INSTALLDIR . DIRECTORY_SEPARATOR . 'public'); $shortoptions = ''; $longoptions = array(); $helptext = <<find()) { while ($user->fetch()) { printfv("Updating user {$user->nickname}..."); try { updateUserUri($user); } catch(Exception $e) { echo "\nError updating {$user->nickname} URI: " . $e->getMessage() . "\n"; } printfv("DONE.\n"); } } } function updateUserUri($user) { $orig = clone($user); $user->uri = common_user_uri($user); $user->updateWithKeys($orig); } main();