mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-21 13:00:56 +01:00
Delete various dead/nonuseful PHID code
Summary: Ref T2715. - Remove the "PHID" application. `phid.query` provides a reasonable way for developers to get this data without requiring a top-level application. - Remove some dead/uncalled code. Test Plan: No more PHID application. Grepped for callsites. Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T2715 Differential Revision: https://secure.phabricator.com/D6511
This commit is contained in:
parent
f2ed56147d
commit
220f0ea4d1
8 changed files with 3 additions and 183 deletions
|
@ -723,7 +723,6 @@ phutil_register_library_map(array(
|
|||
'MetaMTAConstants' => 'applications/metamta/constants/MetaMTAConstants.php',
|
||||
'MetaMTANotificationType' => 'applications/metamta/constants/MetaMTANotificationType.php',
|
||||
'MetaMTAReceivedMailStatus' => 'applications/metamta/constants/MetaMTAReceivedMailStatus.php',
|
||||
'ObjectHandleLoader' => 'applications/phid/handle/ObjectHandleLoader.php',
|
||||
'OwnersPackageReplyHandler' => 'applications/owners/mail/OwnersPackageReplyHandler.php',
|
||||
'PHUI' => 'view/phui/PHUI.php',
|
||||
'PHUIBoxExample' => 'applications/uiexample/examples/PHUIBoxExample.php',
|
||||
|
@ -795,7 +794,6 @@ phutil_register_library_map(array(
|
|||
'PhabricatorApplicationManiphest' => 'applications/maniphest/application/PhabricatorApplicationManiphest.php',
|
||||
'PhabricatorApplicationMetaMTA' => 'applications/metamta/application/PhabricatorApplicationMetaMTA.php',
|
||||
'PhabricatorApplicationOwners' => 'applications/owners/application/PhabricatorApplicationOwners.php',
|
||||
'PhabricatorApplicationPHID' => 'applications/phid/application/PhabricatorApplicationPHID.php',
|
||||
'PhabricatorApplicationPHPAST' => 'applications/phpast/application/PhabricatorApplicationPHPAST.php',
|
||||
'PhabricatorApplicationPaste' => 'applications/paste/application/PhabricatorApplicationPaste.php',
|
||||
'PhabricatorApplicationPeople' => 'applications/people/application/PhabricatorApplicationPeople.php',
|
||||
|
@ -1335,8 +1333,6 @@ phutil_register_library_map(array(
|
|||
'PhabricatorPHDConfigOptions' => 'applications/config/option/PhabricatorPHDConfigOptions.php',
|
||||
'PhabricatorPHID' => 'applications/phid/storage/PhabricatorPHID.php',
|
||||
'PhabricatorPHIDConstants' => 'applications/phid/PhabricatorPHIDConstants.php',
|
||||
'PhabricatorPHIDController' => 'applications/phid/controller/PhabricatorPHIDController.php',
|
||||
'PhabricatorPHIDLookupController' => 'applications/phid/controller/PhabricatorPHIDLookupController.php',
|
||||
'PhabricatorPHIDType' => 'applications/phid/type/PhabricatorPHIDType.php',
|
||||
'PhabricatorPHPMailerConfigOptions' => 'applications/config/option/PhabricatorPHPMailerConfigOptions.php',
|
||||
'PhabricatorPagedFormExample' => 'applications/uiexample/examples/PhabricatorPagedFormExample.php',
|
||||
|
@ -1954,7 +1950,6 @@ phutil_register_library_map(array(
|
|||
'celerity_generate_unique_node_id' => 'infrastructure/celerity/api.php',
|
||||
'celerity_get_resource_uri' => 'infrastructure/celerity/api.php',
|
||||
'celerity_register_resource_map' => 'infrastructure/celerity/map.php',
|
||||
'implode_handle_links' => 'applications/phid/handle/view/render.php',
|
||||
'implode_selected_handle_links' => 'applications/phid/handle/view/render.php',
|
||||
'javelin_tag' => 'infrastructure/javelin/markup.php',
|
||||
'phabricator_date' => 'view/viewutils.php',
|
||||
|
@ -2751,7 +2746,6 @@ phutil_register_library_map(array(
|
|||
'PhabricatorApplicationManiphest' => 'PhabricatorApplication',
|
||||
'PhabricatorApplicationMetaMTA' => 'PhabricatorApplication',
|
||||
'PhabricatorApplicationOwners' => 'PhabricatorApplication',
|
||||
'PhabricatorApplicationPHID' => 'PhabricatorApplication',
|
||||
'PhabricatorApplicationPHPAST' => 'PhabricatorApplication',
|
||||
'PhabricatorApplicationPaste' => 'PhabricatorApplication',
|
||||
'PhabricatorApplicationPeople' => 'PhabricatorApplication',
|
||||
|
@ -3303,8 +3297,6 @@ phutil_register_library_map(array(
|
|||
'PhabricatorOwnersPackageTestCase' => 'PhabricatorTestCase',
|
||||
'PhabricatorOwnersPath' => 'PhabricatorOwnersDAO',
|
||||
'PhabricatorPHDConfigOptions' => 'PhabricatorApplicationConfigOptions',
|
||||
'PhabricatorPHIDController' => 'PhabricatorController',
|
||||
'PhabricatorPHIDLookupController' => 'PhabricatorPHIDController',
|
||||
'PhabricatorPHPMailerConfigOptions' => 'PhabricatorApplicationConfigOptions',
|
||||
'PhabricatorPagedFormExample' => 'PhabricatorUIExample',
|
||||
'PhabricatorPaste' =>
|
||||
|
@ -3943,7 +3935,6 @@ phutil_register_library_map(array(
|
|||
'ReleephFieldSpecificationIncompleteException' => 'Exception',
|
||||
'ReleephIntentFieldSpecification' => 'ReleephFieldSpecification',
|
||||
'ReleephLevelFieldSpecification' => 'ReleephFieldSpecification',
|
||||
'ReleephObjectHandleLoader' => 'ObjectHandleLoader',
|
||||
'ReleephOriginalCommitFieldSpecification' => 'ReleephFieldSpecification',
|
||||
'ReleephPHIDTypeProject' => 'PhabricatorPHIDType',
|
||||
'ReleephPHIDTypeRequest' => 'PhabricatorPHIDType',
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorApplicationPHID extends PhabricatorApplication {
|
||||
|
||||
public function getName() {
|
||||
return 'PHIDs';
|
||||
}
|
||||
|
||||
public function getBaseURI() {
|
||||
return '/phid/';
|
||||
}
|
||||
|
||||
public function getIconName() {
|
||||
return 'phid';
|
||||
}
|
||||
|
||||
public function getShortDescription() {
|
||||
return 'Lookup PHIDs';
|
||||
}
|
||||
|
||||
public function getTitleGlyph() {
|
||||
return "#";
|
||||
}
|
||||
|
||||
public function getApplicationGroup() {
|
||||
return self::GROUP_DEVELOPER;
|
||||
}
|
||||
|
||||
public function getRoutes() {
|
||||
return array(
|
||||
'/phid/' => array(
|
||||
'' => 'PhabricatorPHIDLookupController',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
|
@ -5,11 +5,6 @@
|
|||
*/
|
||||
abstract class ConduitAPI_phid_Method extends ConduitAPIMethod {
|
||||
|
||||
public function getApplication() {
|
||||
return PhabricatorApplication::getByClass(
|
||||
'PhabricatorApplicationPHID');
|
||||
}
|
||||
|
||||
protected function buildHandleInformationDictionary(
|
||||
PhabricatorObjectHandle $handle) {
|
||||
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
<?php
|
||||
|
||||
abstract class PhabricatorPHIDController extends PhabricatorController {
|
||||
|
||||
public function buildStandardPageResponse($view, array $data) {
|
||||
$page = $this->buildStandardPageView();
|
||||
|
||||
$page->setApplicationName('PHID');
|
||||
$page->setBaseURI('/phid/');
|
||||
$page->setTitle(idx($data, 'title'));
|
||||
$page->setGlyph('#');
|
||||
$page->appendChild($view);
|
||||
|
||||
$response = new AphrontWebpageResponse();
|
||||
return $response->setContent($page->render());
|
||||
}
|
||||
|
||||
}
|
|
@ -1,87 +0,0 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorPHIDLookupController
|
||||
extends PhabricatorPHIDController {
|
||||
|
||||
public function processRequest() {
|
||||
|
||||
$request = $this->getRequest();
|
||||
$phids = $request->getStrList('phids');
|
||||
if ($phids) {
|
||||
$handles = $this->loadViewerHandles($phids);
|
||||
|
||||
$rows = array();
|
||||
foreach ($handles as $handle) {
|
||||
if ($handle->getURI()) {
|
||||
$link = phutil_tag(
|
||||
'a',
|
||||
array(
|
||||
'href' => $handle->getURI(),
|
||||
),
|
||||
$handle->getURI());
|
||||
} else {
|
||||
$link = null;
|
||||
}
|
||||
|
||||
$rows[] = array(
|
||||
$handle->getPHID(),
|
||||
$handle->getType(),
|
||||
$handle->getFullName(),
|
||||
$link,
|
||||
);
|
||||
}
|
||||
|
||||
$table = new AphrontTableView($rows);
|
||||
$table->setHeaders(
|
||||
array(
|
||||
'PHID',
|
||||
'Type',
|
||||
'Name',
|
||||
'URI',
|
||||
));
|
||||
$table->setColumnClasses(
|
||||
array(
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
'wide',
|
||||
));
|
||||
|
||||
$panel = new AphrontPanelView();
|
||||
$panel->setHeader('PHID Handles');
|
||||
$panel->appendChild($table);
|
||||
|
||||
return $this->buildStandardPageResponse(
|
||||
$panel,
|
||||
array(
|
||||
'title' => 'PHID Lookup Results',
|
||||
));
|
||||
}
|
||||
|
||||
$lookup_form = new AphrontFormView();
|
||||
$lookup_form->setUser($request->getUser());
|
||||
$lookup_form
|
||||
->setAction('/phid/')
|
||||
->appendChild(
|
||||
id(new AphrontFormTextAreaControl())
|
||||
->setName('phids')
|
||||
->setCaption('Enter PHIDs separated by spaces or commas.'))
|
||||
->appendChild(
|
||||
id(new AphrontFormSubmitControl())
|
||||
->setValue('Lookup PHIDs'));
|
||||
|
||||
$lookup_panel = new AphrontPanelView();
|
||||
$lookup_panel->setHeader('Lookup PHIDs');
|
||||
$lookup_panel->appendChild($lookup_form);
|
||||
$lookup_panel->setWidth(AphrontPanelView::WIDTH_WIDE);
|
||||
|
||||
return $this->buildStandardPageResponse(
|
||||
array(
|
||||
$lookup_panel,
|
||||
),
|
||||
array(
|
||||
'title' => 'PHID Lookup',
|
||||
));
|
||||
}
|
||||
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
<?php
|
||||
|
||||
abstract class ObjectHandleLoader {
|
||||
|
||||
abstract public function loadHandles(array $phids);
|
||||
|
||||
}
|
|
@ -1,25 +1,8 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Implodes a list of handles, rendering their links.
|
||||
*
|
||||
* @group handle
|
||||
* @return PhutilSafeHTML
|
||||
*/
|
||||
function implode_handle_links($glue, array $handles) {
|
||||
|
||||
$items = array();
|
||||
foreach ($handles as $handle) {
|
||||
$items[] = $handle->renderLink();
|
||||
}
|
||||
|
||||
return phutil_implode_html($glue, $items);
|
||||
}
|
||||
|
||||
/**
|
||||
* Like @{function:implode_handle_links}. Implodes selected handles from a pool
|
||||
* of handles. Useful if you load handles for various phids, but only render
|
||||
* a few of them at a time.
|
||||
* Implodes selected handles from a pool of handles. Useful if you load handles
|
||||
* for various phids, but only render a few of them at a time.
|
||||
*
|
||||
* @group handle
|
||||
* @return PhutilSafeHTML
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
final class ReleephObjectHandleLoader extends ObjectHandleLoader {
|
||||
final class ReleephObjectHandleLoader {
|
||||
|
||||
public function loadHandles(array $phids) {
|
||||
$types = array();
|
||||
|
|
Loading…
Reference in a new issue