@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
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Removed "PHID Types" storage object and interface components

Summary:
Removed because code wasn't used or really needed.

Test Plan:
* Tested that "PHID List" and "PHID Lookup" pages work correctly.
* Tested that new PHIDs can be allocated with the predefined set of types

Reviewed By: epriestley
Reviewers: epriestley
CC: epriestley
Differential Revision: 88

+19 -286
+1 -1
resources/sql/init/initialize.sql
··· 841 841 842 842 LOCK TABLES `directory_item` WRITE; 843 843 /*!40000 ALTER TABLE `directory_item` DISABLE KEYS */; 844 - INSERT INTO `directory_item` VALUES (1,'Repositories','Configure tracked source code repositories.','/repository/',1,0,NULL,0,0),(5,'libphutil Docs','Developer documentation for libphutil.','http://phutil.com/libphutil/docs/',2,0,'',1295312416,1295320996),(12,'Files','Blob store for files.','/file/',5,0,'',1295321244,1295816742),(13,'Differential','Code review tool.','/differential/',4,0,'',1295321263,1295321263),(14,'PHID Manager','Manage PHIDs and types.','/phid/',6,0,'',1295762315,1295888577),(15,'People','User directory.','/people/',4,3000,'',1295830520,1295830528),(16,'Conduit Console','Web console for Conduit API.','/conduit/',6,0,'',1295888593,1295888593),(17,'MetaMTA','Yo dawg, we heard you like MTAs...','/mail/',6,0,'',1296006261,1296056065),(18,'XHProf','PHP profiling tool.','/xhprof/',6,0,NULL,1296684238,1296684238),(20,'Maniphest','Construct lists of lists.','/maniphest/',4,0,NULL,1297190663,1297190663); 844 + INSERT INTO `directory_item` VALUES (1,'Repositories','Configure tracked source code repositories.','/repository/',1,0,NULL,0,0),(5,'libphutil Docs','Developer documentation for libphutil.','http://phutil.com/libphutil/docs/',2,0,'',1295312416,1295320996),(12,'Files','Blob store for files.','/file/',5,0,'',1295321244,1295816742),(13,'Differential','Code review tool.','/differential/',4,0,'',1295321263,1295321263),(14,'PHID Manager','Manage PHIDs.','/phid/',6,0,'',1295762315,1295888577),(15,'People','User directory.','/people/',4,3000,'',1295830520,1295830528),(16,'Conduit Console','Web console for Conduit API.','/conduit/',6,0,'',1295888593,1295888593),(17,'MetaMTA','Yo dawg, we heard you like MTAs...','/mail/',6,0,'',1296006261,1296056065),(18,'XHProf','PHP profiling tool.','/xhprof/',6,0,NULL,1296684238,1296684238),(20,'Maniphest','Construct lists of lists.','/maniphest/',4,0,NULL,1297190663,1297190663); 845 845 /*!40000 ALTER TABLE `directory_item` ENABLE KEYS */; 846 846 UNLOCK TABLES; 847 847 /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
+1
resources/sql/patches/012.dropphidtype.sql
··· 1 + DROP TABLE phabricator_phid.phid_type;
-6
src/__phutil_library_map__.php
··· 318 318 'PhabricatorPHIDDAO' => 'applications/phid/storage/base', 319 319 'PhabricatorPHIDListController' => 'applications/phid/controller/list', 320 320 'PhabricatorPHIDLookupController' => 'applications/phid/controller/lookup', 321 - 'PhabricatorPHIDType' => 'applications/phid/storage/type', 322 - 'PhabricatorPHIDTypeEditController' => 'applications/phid/controller/typeedit', 323 - 'PhabricatorPHIDTypeListController' => 'applications/phid/controller/typelist', 324 321 'PhabricatorPeopleController' => 'applications/people/controller/base', 325 322 'PhabricatorPeopleEditController' => 'applications/people/controller/edit', 326 323 'PhabricatorPeopleListController' => 'applications/people/controller/list', ··· 654 651 'PhabricatorPHIDDAO' => 'PhabricatorLiskDAO', 655 652 'PhabricatorPHIDListController' => 'PhabricatorPHIDController', 656 653 'PhabricatorPHIDLookupController' => 'PhabricatorPHIDController', 657 - 'PhabricatorPHIDType' => 'PhabricatorPHIDDAO', 658 - 'PhabricatorPHIDTypeEditController' => 'PhabricatorPHIDController', 659 - 'PhabricatorPHIDTypeListController' => 'PhabricatorPHIDController', 660 654 'PhabricatorPeopleController' => 'PhabricatorController', 661 655 'PhabricatorPeopleEditController' => 'PhabricatorPeopleController', 662 656 'PhabricatorPeopleListController' => 'PhabricatorPeopleController',
-2
src/aphront/default/configuration/AphrontDefaultApplicationConfiguration.php
··· 59 59 '/phid/' => array( 60 60 '$' => 'PhabricatorPHIDLookupController', 61 61 'list/$' => 'PhabricatorPHIDListController', 62 - 'type/$' => 'PhabricatorPHIDTypeListController', 63 - 'type/edit/(?:(?P<id>\d+)/)?$' => 'PhabricatorPHIDTypeEditController', 64 62 'new/$' => 'PhabricatorPHIDAllocateController', 65 63 ), 66 64 '/people/' => array(
+14
src/applications/phid/constants/PhabricatorPHIDConstants.php
··· 29 29 const PHID_TYPE_REPO = 'REPO'; 30 30 const PHID_TYPE_CMIT = 'CMIT'; 31 31 32 + public static function getTypes() { 33 + return array( 34 + self::PHID_TYPE_USER, 35 + self::PHID_TYPE_MLST, 36 + self::PHID_TYPE_DREV, 37 + self::PHID_TYPE_TASK, 38 + self::PHID_TYPE_FILE, 39 + self::PHID_TYPE_PROJ, 40 + self::PHID_TYPE_UNKNOWN, 41 + self::PHID_TYPE_MAGIC, 42 + self::PHID_TYPE_REPO, 43 + self::PHID_TYPE_CMIT, 44 + ); 45 + } 32 46 }
+2 -2
src/applications/phid/controller/allocate/PhabricatorPHIDAllocateController.php
··· 30 30 ->setURI('/phid/?phid='.phutil_escape_uri($phid)); 31 31 } 32 32 33 - $types = id(new PhabricatorPHIDType())->loadAll(); 33 + $types = PhabricatorPHIDConstants::getTypes(); 34 34 35 35 $options = array(); 36 36 foreach ($types as $type) { 37 - $options[$type->getType()] = $type->getType().': '.$type->getName(); 37 + $options[$type] = $type; 38 38 } 39 39 asort($options); 40 40
+1 -1
src/applications/phid/controller/allocate/__init__.php
··· 7 7 8 8 9 9 phutil_require_module('phabricator', 'aphront/response/redirect'); 10 + phutil_require_module('phabricator', 'applications/phid/constants'); 10 11 phutil_require_module('phabricator', 'applications/phid/controller/base'); 11 12 phutil_require_module('phabricator', 'applications/phid/storage/phid'); 12 - phutil_require_module('phabricator', 'applications/phid/storage/type'); 13 13 phutil_require_module('phabricator', 'view/form/base'); 14 14 phutil_require_module('phabricator', 'view/form/control/submit'); 15 15 phutil_require_module('phabricator', 'view/layout/panel');
-4
src/applications/phid/controller/base/PhabricatorPHIDController.php
··· 34 34 'href' => '/phid/list/', 35 35 'name' => 'PHID List', 36 36 ), 37 - 'types' => array( 38 - 'href' => '/phid/type/', 39 - 'name' => 'PHID Types', 40 - ), 41 37 ), 42 38 idx($data, 'tab')); 43 39 $page->setGlyph('#');
-135
src/applications/phid/controller/typeedit/PhabricatorPHIDTypeEditController.php
··· 1 - <?php 2 - 3 - /* 4 - * Copyright 2011 Facebook, Inc. 5 - * 6 - * Licensed under the Apache License, Version 2.0 (the "License"); 7 - * you may not use this file except in compliance with the License. 8 - * You may obtain a copy of the License at 9 - * 10 - * http://www.apache.org/licenses/LICENSE-2.0 11 - * 12 - * Unless required by applicable law or agreed to in writing, software 13 - * distributed under the License is distributed on an "AS IS" BASIS, 14 - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 - * See the License for the specific language governing permissions and 16 - * limitations under the License. 17 - */ 18 - 19 - class PhabricatorPHIDTypeEditController 20 - extends PhabricatorPHIDController { 21 - 22 - private $id; 23 - 24 - public function willProcessRequest(array $data) { 25 - $this->id = idx($data, 'id'); 26 - } 27 - 28 - public function processRequest() { 29 - 30 - if ($this->id) { 31 - $type = id(new PhabricatorPHIDType())->load($this->id); 32 - if (!$type) { 33 - return new Aphront404Response(); 34 - } 35 - } else { 36 - $type = new PhabricatorPHIDType(); 37 - } 38 - 39 - $e_type = true; 40 - $e_name = true; 41 - $errors = array(); 42 - 43 - $request = $this->getRequest(); 44 - if ($request->isFormPost()) { 45 - $type->setName($request->getStr('name')); 46 - if (!$type->getID()) { 47 - $type->setType($request->getStr('type')); 48 - } 49 - $type->setDescription($request->getStr('description')); 50 - 51 - if (!strlen($type->getType())) { 52 - $errors[] = 'Type code is required.'; 53 - $e_type = 'Required'; 54 - } 55 - 56 - if (!strlen($type->getName())) { 57 - $errors[] = 'Type name is required.'; 58 - $e_name = 'Required'; 59 - } 60 - 61 - if (!$errors) { 62 - $type->save(); 63 - return id(new AphrontRedirectResponse()) 64 - ->setURI('/phid/type/'); 65 - } 66 - } 67 - 68 - $error_view = null; 69 - if ($errors) { 70 - $error_view = id(new AphrontErrorView()) 71 - ->setTitle('Form Errors') 72 - ->setErrors($errors); 73 - } 74 - 75 - $form = new AphrontFormView(); 76 - $form->setUser($request->getUser()); 77 - 78 - if ($type->getID()) { 79 - $form->setAction('/phid/type/edit/'.$type->getID().'/'); 80 - } else { 81 - $form->setAction('/phid/type/edit/'); 82 - } 83 - 84 - if ($type->getID()) { 85 - $type_immutable = true; 86 - } else { 87 - $type_immutable = false; 88 - } 89 - 90 - 91 - $form 92 - ->appendChild( 93 - id(new AphrontFormTextControl()) 94 - ->setLabel('Type') 95 - ->setName('type') 96 - ->setValue($type->getType()) 97 - ->setError($e_type) 98 - ->setCaption( 99 - 'Four character type identifier. This can not be changed once '. 100 - 'it is created.') 101 - ->setDisabled($type_immutable)) 102 - ->appendChild( 103 - id(new AphrontFormTextControl()) 104 - ->setLabel('Name') 105 - ->setName('name') 106 - ->setValue($type->getName()) 107 - ->setError($e_name)) 108 - ->appendChild( 109 - id(new AphrontFormTextAreaControl()) 110 - ->setLabel('Description') 111 - ->setName('description') 112 - ->setValue($type->getDescription())) 113 - ->appendChild( 114 - id(new AphrontFormSubmitControl()) 115 - ->setValue('Save') 116 - ->addCancelButton('/phid/type/')); 117 - 118 - $panel = new AphrontPanelView(); 119 - if ($type->getID()) { 120 - $panel->setHeader('Edit PHID Type'); 121 - } else { 122 - $panel->setHeader('Create New PHID Type'); 123 - } 124 - 125 - $panel->appendChild($form); 126 - $panel->setWidth(AphrontPanelView::WIDTH_FORM); 127 - 128 - return $this->buildStandardPageResponse( 129 - array($error_view, $panel), 130 - array( 131 - 'title' => 'Edit PHID Type', 132 - )); 133 - } 134 - 135 - }
-21
src/applications/phid/controller/typeedit/__init__.php
··· 1 - <?php 2 - /** 3 - * This file is automatically generated. Lint this module to rebuild it. 4 - * @generated 5 - */ 6 - 7 - 8 - 9 - phutil_require_module('phabricator', 'aphront/response/404'); 10 - phutil_require_module('phabricator', 'aphront/response/redirect'); 11 - phutil_require_module('phabricator', 'applications/phid/controller/base'); 12 - phutil_require_module('phabricator', 'applications/phid/storage/type'); 13 - phutil_require_module('phabricator', 'view/form/base'); 14 - phutil_require_module('phabricator', 'view/form/control/submit'); 15 - phutil_require_module('phabricator', 'view/form/error'); 16 - phutil_require_module('phabricator', 'view/layout/panel'); 17 - 18 - phutil_require_module('phutil', 'utils'); 19 - 20 - 21 - phutil_require_source('PhabricatorPHIDTypeEditController.php');
-59
src/applications/phid/controller/typelist/PhabricatorPHIDTypeListController.php
··· 1 - <?php 2 - 3 - /* 4 - * Copyright 2011 Facebook, Inc. 5 - * 6 - * Licensed under the Apache License, Version 2.0 (the "License"); 7 - * you may not use this file except in compliance with the License. 8 - * You may obtain a copy of the License at 9 - * 10 - * http://www.apache.org/licenses/LICENSE-2.0 11 - * 12 - * Unless required by applicable law or agreed to in writing, software 13 - * distributed under the License is distributed on an "AS IS" BASIS, 14 - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 - * See the License for the specific language governing permissions and 16 - * limitations under the License. 17 - */ 18 - 19 - class PhabricatorPHIDTypeListController 20 - extends PhabricatorPHIDController { 21 - 22 - public function processRequest() { 23 - $items = id(new PhabricatorPHIDType())->loadAll(); 24 - 25 - $rows = array(); 26 - foreach ($items as $item) { 27 - $rows[] = array( 28 - $item->getID(), 29 - phutil_escape_html($item->getType()), 30 - phutil_escape_html($item->getName()), 31 - ); 32 - } 33 - 34 - $table = new AphrontTableView($rows); 35 - $table->setHeaders( 36 - array( 37 - 'ID', 38 - 'Type Code', 39 - 'Name', 40 - )); 41 - $table->setColumnClasses( 42 - array( 43 - null, 44 - null, 45 - 'wide', 46 - )); 47 - 48 - $panel = new AphrontPanelView(); 49 - $panel->appendChild($table); 50 - $panel->setHeader('PHID Types'); 51 - $panel->setCreateButton('New Type', '/phid/type/edit/'); 52 - 53 - return $this->buildStandardPageResponse($panel, array( 54 - 'title' => 'PHID Types', 55 - 'tab' => 'types', 56 - )); 57 - } 58 - 59 - }
-18
src/applications/phid/controller/typelist/__init__.php
··· 1 - <?php 2 - /** 3 - * This file is automatically generated. Lint this module to rebuild it. 4 - * @generated 5 - */ 6 - 7 - 8 - 9 - phutil_require_module('phabricator', 'applications/phid/controller/base'); 10 - phutil_require_module('phabricator', 'applications/phid/storage/type'); 11 - phutil_require_module('phabricator', 'view/control/table'); 12 - phutil_require_module('phabricator', 'view/layout/panel'); 13 - 14 - phutil_require_module('phutil', 'markup'); 15 - phutil_require_module('phutil', 'utils'); 16 - 17 - 18 - phutil_require_source('PhabricatorPHIDTypeListController.php');
-25
src/applications/phid/storage/type/PhabricatorPHIDType.php
··· 1 - <?php 2 - 3 - /* 4 - * Copyright 2011 Facebook, Inc. 5 - * 6 - * Licensed under the Apache License, Version 2.0 (the "License"); 7 - * you may not use this file except in compliance with the License. 8 - * You may obtain a copy of the License at 9 - * 10 - * http://www.apache.org/licenses/LICENSE-2.0 11 - * 12 - * Unless required by applicable law or agreed to in writing, software 13 - * distributed under the License is distributed on an "AS IS" BASIS, 14 - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 - * See the License for the specific language governing permissions and 16 - * limitations under the License. 17 - */ 18 - 19 - class PhabricatorPHIDType extends PhabricatorPHIDDAO { 20 - 21 - protected $type; 22 - protected $name; 23 - protected $description; 24 - 25 - }
-12
src/applications/phid/storage/type/__init__.php
··· 1 - <?php 2 - /** 3 - * This file is automatically generated. Lint this module to rebuild it. 4 - * @generated 5 - */ 6 - 7 - 8 - 9 - phutil_require_module('phabricator', 'applications/phid/storage/base'); 10 - 11 - 12 - phutil_require_source('PhabricatorPHIDType.php');