Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99301781
20130711.trimrealnames.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Jan 23, 06:24
Size
571 B
Mime Type
text/x-php
Expires
Sat, Jan 25, 06:24 (1 d, 19 h)
Engine
blob
Format
Raw Data
Handle
23771942
Attached To
rPH Phabricator
20130711.trimrealnames.php
View Options
<?php
$table
=
new
PhabricatorUser
();
$conn_w
=
$table
->
establishConnection
(
'w'
);
echo
"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
"User {$id} is already trim.
\n
"
;
continue
;
}
echo
"Trimming user {$id} from '{$real}' to '{$trim}'.
\n
"
;
qsprintf
(
$conn_w
,
'UPDATE %T SET realName = %s WHERE id = %d'
,
$table
->
getTableName
(),
$real
,
$id
);
}
echo
"Done.
\n
"
;
Event Timeline
Log In to Comment