Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F102239885
PhabricatorRepositoryDeleteController.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
Tue, Feb 18, 15:34
Size
1 KB
Mime Type
text/x-php
Expires
Thu, Feb 20, 15:34 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
24282051
Attached To
rPH Phabricator
PhabricatorRepositoryDeleteController.php
View Options
<?php
final
class
PhabricatorRepositoryDeleteController
extends
PhabricatorRepositoryController
{
private
$id
;
public
function
willProcessRequest
(
array
$data
)
{
$this
->
id
=
$data
[
'id'
];
}
public
function
processRequest
()
{
$viewer
=
$this
->
getRequest
()->
getUser
();
$repository
=
id
(
new
PhabricatorRepositoryQuery
())
->
setViewer
(
$viewer
)
->
withIDs
(
array
(
$this
->
id
))
->
executeOne
();
if
(!
$repository
)
{
return
new
Aphront404Response
();
}
$request
=
$this
->
getRequest
();
if
(
$request
->
isDialogFormPost
())
{
return
id
(
new
AphrontRedirectResponse
())->
setURI
(
'/repository/'
);
}
$dialog
=
new
AphrontDialogView
();
$text_1
=
pht
(
'If you really want to delete the repository, you must run:'
);
$command
=
'bin/repository delete '
.
$repository
->
getCallsign
();
$text_2
=
pht
(
'Repositories touch many objects and as such deletes are '
.
'prohibitively expensive to run from the web UI.'
);
$body
=
phutil_tag
(
'div'
,
array
(
'class'
=>
'phabricator-remarkup'
,
),
array
(
phutil_tag
(
'p'
,
array
(),
$text_1
),
phutil_tag
(
'p'
,
array
(),
phutil_tag
(
'tt'
,
array
(),
$command
)),
phutil_tag
(
'p'
,
array
(),
$text_2
),
));
$dialog
->
setUser
(
$request
->
getUser
())
->
setTitle
(
pht
(
'Really want to delete the repository?'
))
->
appendChild
(
$body
)
->
setSubmitURI
(
'/repository/delete/'
.
$this
->
id
.
'/'
)
->
addSubmitButton
(
pht
(
'Okay'
));
return
id
(
new
AphrontDialogResponse
())->
setDialog
(
$dialog
);
}
}
Event Timeline
Log In to Comment