@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
at upstream/main 51 lines 1.7 kB view raw
1<?php 2 3final class DiffusionRepositoryEditDeleteController 4 extends DiffusionRepositoryManageController { 5 6 public function handleRequest(AphrontRequest $request) { 7 // This is just an information box, telling admins to use CLI for destroy. 8 // To increase shared knowledge about how Phorge works, we can safely show 9 // it to those who see the repository, not just those who can edit it. 10 $response = $this->loadDiffusionContext(); 11 if ($response) { 12 return $response; 13 } 14 15 $viewer = $this->getViewer(); 16 $drequest = $this->getDiffusionRequest(); 17 $repository = $drequest->getRepository(); 18 19 $panel_uri = id(new DiffusionRepositoryBasicsManagementPanel()) 20 ->setRepository($repository) 21 ->getPanelURI(); 22 23 $doc_uri = PhabricatorEnv::getDoclink( 24 'Permanently Destroying Data'); 25 26 return $this->newDialog() 27 ->setTitle(pht('Delete Repository')) 28 ->appendParagraph( 29 pht( 30 'To permanently destroy this repository, run this command from '. 31 'the command line:')) 32 ->appendCommand( 33 csprintf( 34 '%s $ ./bin/remove destroy %R', 35 PlatformSymbols::getPlatformServerPath(), 36 $repository->getMonogram())) 37 ->appendParagraph( 38 pht( 39 'Repositories can not be permanently destroyed from the web '. 40 'interface. See %s in the documentation for more information.', 41 phutil_tag( 42 'a', 43 array( 44 'href' => $doc_uri, 45 'target' => '_blank', 46 ), 47 pht('Permanently Destroying Data')))) 48 ->addCancelButton($panel_uri, pht('Close')); 49 } 50 51}