Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99662353
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, Jan 26, 01:22
Size
555 B
Mime Type
text/x-php
Expires
Tue, Jan 28, 01:22 (2 d)
Engine
blob
Format
Raw Data
Handle
23840399
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