Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93019859
20170811.differential.03.modernxaction.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
Mon, Nov 25, 15:05
Size
850 B
Mime Type
text/x-php
Expires
Wed, Nov 27, 15:05 (2 d)
Engine
blob
Format
Raw Data
Handle
22559432
Attached To
rPH Phabricator
20170811.differential.03.modernxaction.php
View Options
<?php
$map
=
array
(
'0'
=>
'needs-review'
,
'1'
=>
'needs-revision'
,
'2'
=>
'accepted'
,
'3'
=>
'published'
,
'4'
=>
'abandoned'
,
'5'
=>
'changes-planned'
,
);
$table
=
new
DifferentialTransaction
();
$conn
=
$table
->
establishConnection
(
'w'
);
foreach
(
new
LiskMigrationIterator
(
$table
)
as
$xaction
)
{
$type
=
$xaction
->
getTransactionType
();
if
((
$type
!=
'differential:status'
)
&&
(
$type
!=
'differential.revision.status'
))
{
continue
;
}
$old
=
$xaction
->
getOldValue
();
$new
=
$xaction
->
getNewValue
();
$old
=
idx
(
$map
,
$old
,
$old
);
$new
=
idx
(
$map
,
$new
,
$new
);
queryfx
(
$conn
,
'UPDATE %T SET transactionType = %s, oldValue = %s, newValue = %s
WHERE id = %d'
,
$table
->
getTableName
(),
'differential.revision.status'
,
json_encode
(
$old
),
json_encode
(
$new
),
$xaction
->
getID
());
}
Event Timeline
Log In to Comment