Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F106242851
20150622.metamta.5.actor-phid-mig.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
Sun, Mar 23, 22:48
Size
555 B
Mime Type
text/x-php
Expires
Tue, Mar 25, 22:48 (2 d)
Engine
blob
Format
Raw Data
Handle
25097844
Attached To
rPH Phabricator
20150622.metamta.5.actor-phid-mig.php
View Options
<?php
$table
=
new
PhabricatorMetaMTAMail
();
$conn_w
=
$table
->
establishConnection
(
'w'
);
echo
pht
(
'Assigning actorPHIDs to mails...'
).
"
\n
"
;
foreach
(
new
LiskMigrationIterator
(
$table
)
as
$mail
)
{
$id
=
$mail
->
getID
();
echo
pht
(
'Updating mail %d...'
,
$id
).
"
\n
"
;
if
(
$mail
->
getActorPHID
())
{
continue
;
}
$actor_phid
=
$mail
->
getFrom
();
if
(
$actor_phid
===
null
)
{
continue
;
}
queryfx
(
$conn_w
,
'UPDATE %T SET actorPHID = %s WHERE id = %d'
,
$table
->
getTableName
(),
$actor_phid
,
$id
);
}
echo
pht
(
'Done.'
).
"
\n
"
;
Event Timeline
Log In to Comment