Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F950223
20130711.trimrealnames.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
611 B
Referenced Files
None
Subscribers
None
20130711.trimrealnames.php
View Options
<?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
"
;
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Jun 17, 2:00 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
224121
Default Alt Text
20130711.trimrealnames.php (611 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment