Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F5507990
nuker.php
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
epriestley
Apr 6 2018, 12:03 AM
2018-04-06 00:03:47 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
nuker.php
View Options
<?php
require_once
'/usr/local/phab/phabricator/scripts/__init_script__.php'
;
$phids
=
file_get_contents
(
'php://stdin'
);
$phids
=
explode
(
"
\n
"
,
$phids
);
$phids
=
array_filter
(
$phids
);
$diff_table
=
id
(
new
DifferentialDiff
())->
getTableName
();
$changeset_table
=
id
(
new
DifferentialChangeset
())->
getTableName
();
$property_table
=
id
(
new
DifferentialDiffProperty
())->
getTableName
();
$hunk_table
=
id
(
new
DifferentialHunk
())->
getTableName
();
$modern_table
=
id
(
new
DifferentialHunkModern
())->
getTableName
();
$conn
=
id
(
new
DifferentialDiff
())->
establishConnection
(
'w'
);
foreach
(
$phids
as
$phid
)
{
$diff
=
id
(
new
DifferentialDiff
())->
loadOneWhere
(
'phid = %s'
,
$phid
);
if
(!
$diff
)
{
echo
'x'
;
continue
;
}
$diff_id
=
$diff
->
getID
();
queryfx
(
$conn
,
'DELETE FROM %T WHERE diffID = %d'
,
$property_table
,
$diff_id
);
$changesets
=
queryfx_all
(
$conn
,
'SELECT id FROM %T WHERE diffID = %d'
,
$changeset_table
,
$diff_id
)
$changeset_ids
=
ipull
(
$changesets
,
'id'
);
if
(
$changeset_ids
)
{
queryfx
(
$conn
,
'DELETE FROM %T WHERE changesetID IN (%Ld)'
,
$hunk_table
,
$changeset_ids
);
queryfx
(
$conn
,
'DELETE FROM %T WHERE changesetID IN (%Ld)'
,
$modern_table
,
$changeset_ids
);
}
quefyfx
(
$conn
,
'DELETE FROM %T WHERE diffID = %d'
,
$changeset_table
,
$diff_id
);
queryfx
(
$conn
,
'DELETE FROM %T WHERE id = %d'
,
$diff_table
,
$diff_id
);
echo
'.'
;
}
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
994023
Default Alt Text
nuker.php (1 KB)
Attached To
Mode
P2088 nuker.php
Attached
Detach File
Event Timeline
Log In to Comment