Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F548116
20161005.conpherence.image.2.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
871 B
Referenced Files
None
Subscribers
None
20161005.conpherence.image.2.php
View Options
<?php
// Rebuild all Conpherence Room images to profile standards
//
$table
=
new
ConpherenceThread
();
$conn
=
$table
->
establishConnection
(
'w'
);
$table_name
=
'conpherence_thread'
;
foreach
(
new
LiskRawMigrationIterator
(
$conn
,
$table_name
)
as
$row
)
{
$images
=
phutil_json_decode
(
$row
[
'imagePHIDs'
]);
if
(!
$images
)
{
return
;
}
$file_phid
=
idx
(
$images
,
'original'
);
$file
=
id
(
new
PhabricatorFileQuery
())
->
setViewer
(
PhabricatorUser
::
getOmnipotentUser
())
->
withPHIDs
(
array
(
$file_phid
))
->
executeOne
();
$xform
=
PhabricatorFileTransform
::
getTransformByKey
(
PhabricatorFileThumbnailTransform
::
TRANSFORM_PROFILE
);
$xformed
=
$xform
->
executeTransform
(
$file
);
$new_phid
=
$xformed
->
getPHID
();
queryfx
(
$conn
,
'UPDATE %T SET profileImagePHID = %s WHERE id = %d'
,
$table
->
getTableName
(),
$new_phid
,
$row
[
'id'
]);
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 12, 1:44 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
122889
Default Alt Text
20161005.conpherence.image.2.php (871 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment