From e1209be057fd4567204b7a45fcf985af4b9c98f3 Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 8 Jul 2011 22:15:50 -0700 Subject: [PATCH] Remove PhabricatorPHIDAllocateController Summary: This is not very useful and not exposed on the web UI. It's also the only caller for PhabricatorPHIDConstants::getTypes(). I originally wrote this to test PHID allocation when I built the PHID system but it's no longer really useful in any way. phid.allocate might be useful to expose over Conduit eventually but the implementation is trivial. Test Plan: Grepped for controller and method names, came up empty. Reviewed By: codeblock Reviewers: jungejason, tuomaspelkonen, aran, codeblock CC: aran, codeblock Differential Revision: 625 --- ...AphrontDefaultApplicationConfiguration.php | 1 - .../constants/PhabricatorPHIDConstants.php | 18 ----- .../PhabricatorPHIDAllocateController.php | 69 ------------------- .../phid/controller/allocate/__init__.php | 22 ------ 4 files changed, 110 deletions(-) delete mode 100644 src/applications/phid/controller/allocate/PhabricatorPHIDAllocateController.php delete mode 100644 src/applications/phid/controller/allocate/__init__.php diff --git a/src/aphront/default/configuration/AphrontDefaultApplicationConfiguration.php b/src/aphront/default/configuration/AphrontDefaultApplicationConfiguration.php index 0269123922..7bc7808c14 100644 --- a/src/aphront/default/configuration/AphrontDefaultApplicationConfiguration.php +++ b/src/aphront/default/configuration/AphrontDefaultApplicationConfiguration.php @@ -68,7 +68,6 @@ class AphrontDefaultApplicationConfiguration '/phid/' => array( '$' => 'PhabricatorPHIDLookupController', 'list/$' => 'PhabricatorPHIDListController', - 'new/$' => 'PhabricatorPHIDAllocateController', ), '/people/' => array( '$' => 'PhabricatorPeopleListController', diff --git a/src/applications/phid/constants/PhabricatorPHIDConstants.php b/src/applications/phid/constants/PhabricatorPHIDConstants.php index ffb0a84a85..7f0d237a54 100644 --- a/src/applications/phid/constants/PhabricatorPHIDConstants.php +++ b/src/applications/phid/constants/PhabricatorPHIDConstants.php @@ -33,22 +33,4 @@ final class PhabricatorPHIDConstants { const PHID_TYPE_STRY = 'STRY'; const PHID_TYPE_POLL = 'POLL'; - public static function getTypes() { - return array( - self::PHID_TYPE_USER, - self::PHID_TYPE_MLST, - self::PHID_TYPE_DREV, - self::PHID_TYPE_TASK, - self::PHID_TYPE_FILE, - self::PHID_TYPE_PROJ, - self::PHID_TYPE_UNKNOWN, - self::PHID_TYPE_MAGIC, - self::PHID_TYPE_REPO, - self::PHID_TYPE_CMIT, - self::PHID_TYPE_PSTE, - self::PHID_TYPE_OPKG, - self::PHID_TYPE_STRY, - self::PHID_TYPE_POLL, - ); - } } diff --git a/src/applications/phid/controller/allocate/PhabricatorPHIDAllocateController.php b/src/applications/phid/controller/allocate/PhabricatorPHIDAllocateController.php deleted file mode 100644 index 1775149c9b..0000000000 --- a/src/applications/phid/controller/allocate/PhabricatorPHIDAllocateController.php +++ /dev/null @@ -1,69 +0,0 @@ -getRequest(); - if ($request->isFormPost()) { - $type = $request->getStr('type'); - $phid = PhabricatorPHID::generateNewPHID($type); - - return id(new AphrontRedirectResponse()) - ->setURI('/phid/?phid='.phutil_escape_uri($phid)); - } - - $types = PhabricatorPHIDConstants::getTypes(); - - $options = array(); - foreach ($types as $type) { - $options[$type] = $type; - } - asort($options); - - $form = new AphrontFormView(); - $form->setUser($request->getUser()); - $form->setAction('/phid/new/'); - - $form - ->appendChild( - id(new AphrontFormSelectControl()) - ->setLabel('PHID Type') - ->setName('type') - ->setOptions($options)) - ->appendChild( - id(new AphrontFormSubmitControl()) - ->setValue('Allocate') - ->addCancelButton('/phid/')); - - $panel = new AphrontPanelView(); - $panel->setHeader('Allocate New PHID'); - - $panel->appendChild($form); - $panel->setWidth(AphrontPanelView::WIDTH_FORM); - - return $this->buildStandardPageResponse( - array($panel), - array( - 'title' => 'Allocate New PHID', - )); - } - -} diff --git a/src/applications/phid/controller/allocate/__init__.php b/src/applications/phid/controller/allocate/__init__.php deleted file mode 100644 index 863eb1b9bc..0000000000 --- a/src/applications/phid/controller/allocate/__init__.php +++ /dev/null @@ -1,22 +0,0 @@ -