1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-22 05:20:56 +01:00

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
This commit is contained in:
epriestley 2011-07-08 22:15:50 -07:00
parent 1183f5cef7
commit e1209be057
4 changed files with 0 additions and 110 deletions

View file

@ -68,7 +68,6 @@ class AphrontDefaultApplicationConfiguration
'/phid/' => array( '/phid/' => array(
'$' => 'PhabricatorPHIDLookupController', '$' => 'PhabricatorPHIDLookupController',
'list/$' => 'PhabricatorPHIDListController', 'list/$' => 'PhabricatorPHIDListController',
'new/$' => 'PhabricatorPHIDAllocateController',
), ),
'/people/' => array( '/people/' => array(
'$' => 'PhabricatorPeopleListController', '$' => 'PhabricatorPeopleListController',

View file

@ -33,22 +33,4 @@ final class PhabricatorPHIDConstants {
const PHID_TYPE_STRY = 'STRY'; const PHID_TYPE_STRY = 'STRY';
const PHID_TYPE_POLL = 'POLL'; 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,
);
}
} }

View file

@ -1,69 +0,0 @@
<?php
/*
* Copyright 2011 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
class PhabricatorPHIDAllocateController
extends PhabricatorPHIDController {
public function processRequest() {
$request = $this->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',
));
}
}

View file

@ -1,22 +0,0 @@
<?php
/**
* This file is automatically generated. Lint this module to rebuild it.
* @generated
*/
phutil_require_module('phabricator', 'aphront/response/redirect');
phutil_require_module('phabricator', 'applications/phid/constants');
phutil_require_module('phabricator', 'applications/phid/controller/base');
phutil_require_module('phabricator', 'applications/phid/storage/phid');
phutil_require_module('phabricator', 'view/form/base');
phutil_require_module('phabricator', 'view/form/control/select');
phutil_require_module('phabricator', 'view/form/control/submit');
phutil_require_module('phabricator', 'view/layout/panel');
phutil_require_module('phutil', 'markup');
phutil_require_module('phutil', 'utils');
phutil_require_source('PhabricatorPHIDAllocateController.php');