mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-30 01:10:58 +01:00
36e2d02d6e
Summary: `pht`ize a whole bunch of strings in rP. Test Plan: Intense eyeballing. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: hach-que, Korvin, epriestley Differential Revision: https://secure.phabricator.com/D12797
26 lines
611 B
PHP
26 lines
611 B
PHP
<?php
|
|
|
|
$table = new PhabricatorUser();
|
|
$conn_w = $table->establishConnection('w');
|
|
|
|
echo pht('Trimming trailing whitespace from user real names...')."\n";
|
|
foreach (new LiskMigrationIterator($table) as $user) {
|
|
$id = $user->getID();
|
|
$real = $user->getRealName();
|
|
$trim = rtrim($real);
|
|
|
|
if ($trim == $real) {
|
|
echo pht('User %d is already trim.', $id)."\n";
|
|
continue;
|
|
}
|
|
|
|
echo pht("Trimming user %d from '%s' to '%s'.", $id, $real, $trim)."\n";
|
|
qsprintf(
|
|
$conn_w,
|
|
'UPDATE %T SET realName = %s WHERE id = %d',
|
|
$table->getTableName(),
|
|
$real,
|
|
$id);
|
|
}
|
|
|
|
echo pht('Done.')."\n";
|