Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F121337396
20130801.pastexactions.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, Jul 10, 03:32
Size
1 KB
Mime Type
text/x-php
Expires
Sat, Jul 12, 03:32 (2 d)
Engine
blob
Format
Raw Data
Handle
27312046
Attached To
rPH Phabricator
20130801.pastexactions.php
View Options
<?php
$table
=
new
PhabricatorPaste
();
$x_table
=
new
PhabricatorPasteTransaction
();
$conn_w
=
$table
->
establishConnection
(
'w'
);
$conn_w
->
openTransaction
();
echo
"Adding transactions for existing paste objects...
\n
"
;
$rows
=
new
LiskRawMigrationIterator
(
$conn_w
,
'pastebin_paste'
);
foreach
(
$rows
as
$row
)
{
$id
=
$row
[
'id'
];
echo
"Adding transactions for paste id {$id}...
\n
"
;
$xaction_phid
=
PhabricatorPHID
::
generateNewPHID
(
PhabricatorApplicationTransactionPHIDTypeTransaction
::
TYPECONST
);
queryfx
(
$conn_w
,
'INSERT INTO %T (phid, authorPHID, objectPHID, viewPolicy, editPolicy,
transactionType, oldValue, newValue,
contentSource, metadata, dateCreated, dateModified,
commentVersion)
VALUES (%s, %s, %s, %s, %s, %s, %ns, %ns, %s, %s, %d, %d, %d)'
,
$x_table
->
getTableName
(),
$xaction_phid
,
$row
[
'authorPHID'
],
$row
[
'phid'
],
'public'
,
$row
[
'authorPHID'
],
PhabricatorPasteTransaction
::
TYPE_CONTENT
,
'null'
,
$row
[
'filePHID'
],
PhabricatorContentSource
::
newForSource
(
PhabricatorContentSource
::
SOURCE_LEGACY
,
array
())->
serialize
(),
'[]'
,
$row
[
'dateCreated'
],
$row
[
'dateCreated'
],
0
);
}
$conn_w
->
saveTransaction
();
echo
"Done.
\n
"
;
Event Timeline
Log In to Comment