@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.

Move Conpherence Threads to new phid stuff

Summary: Ref T2715.

Test Plan: loaded conpherence, loaded a different thread, made a conpherence. also phid.query

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2715

Differential Revision: https://secure.phabricator.com/D6577

+53 -34
+2
src/__phutil_library_map__.php
··· 989 989 'PhabricatorConfigTransaction' => 'applications/config/storage/PhabricatorConfigTransaction.php', 990 990 'PhabricatorConfigTransactionQuery' => 'applications/config/query/PhabricatorConfigTransactionQuery.php', 991 991 'PhabricatorConfigValidationException' => 'applications/config/exception/PhabricatorConfigValidationException.php', 992 + 'PhabricatorConpherencePHIDTypeThread' => 'applications/conpherence/phid/PhabricatorConpherencePHIDTypeThread.php', 992 993 'PhabricatorContentSource' => 'applications/metamta/contentsource/PhabricatorContentSource.php', 993 994 'PhabricatorContentSourceView' => 'applications/metamta/contentsource/PhabricatorContentSourceView.php', 994 995 'PhabricatorController' => 'applications/base/controller/PhabricatorController.php', ··· 3004 3005 'PhabricatorConfigTransaction' => 'PhabricatorApplicationTransaction', 3005 3006 'PhabricatorConfigTransactionQuery' => 'PhabricatorApplicationTransactionQuery', 3006 3007 'PhabricatorConfigValidationException' => 'Exception', 3008 + 'PhabricatorConpherencePHIDTypeThread' => 'PhabricatorPHIDType', 3007 3009 'PhabricatorContentSourceView' => 'AphrontView', 3008 3010 'PhabricatorController' => 'AphrontController', 3009 3011 'PhabricatorCoreConfigOptions' => 'PhabricatorApplicationConfigOptions',
+49
src/applications/conpherence/phid/PhabricatorConpherencePHIDTypeThread.php
··· 1 + <?php 2 + 3 + /** 4 + * @group conpherence 5 + */ 6 + final class PhabricatorConpherencePHIDTypeThread extends PhabricatorPHIDType { 7 + 8 + const TYPECONST = 'CONP'; 9 + 10 + public function getTypeConstant() { 11 + return self::TYPECONST; 12 + } 13 + 14 + public function getTypeName() { 15 + return pht('Conpherence Thread'); 16 + } 17 + 18 + public function newObject() { 19 + return new ConpherenceThread(); 20 + } 21 + 22 + public function loadObjects( 23 + PhabricatorObjectQuery $query, 24 + array $phids) { 25 + 26 + return id(new ConpherenceThreadQuery()) 27 + ->withPHIDs($phids) 28 + ->setViewer($query->getViewer()) 29 + ->execute(); 30 + } 31 + 32 + public function loadHandles( 33 + PhabricatorHandleQuery $query, 34 + array $handles, 35 + array $objects) { 36 + 37 + foreach ($handles as $phid => $handle) { 38 + $thread = $objects[$phid]; 39 + $name = $thread->getTitle(); 40 + if (!strlen($name)) { 41 + $name = pht('[No Title]'); 42 + } 43 + $handle->setName($name); 44 + $handle->setFullName($name); 45 + $handle->setURI('/conpherence/'.$thread->getID().'/'); 46 + } 47 + } 48 + 49 + }
+1 -1
src/applications/conpherence/storage/ConpherenceThread.php
··· 31 31 32 32 public function generatePHID() { 33 33 return PhabricatorPHID::generateNewPHID( 34 - PhabricatorPHIDConstants::PHID_TYPE_CONP); 34 + PhabricatorConpherencePHIDTypeThread::TYPECONST); 35 35 } 36 36 37 37 public function save() {
+1 -1
src/applications/conpherence/storage/ConpherenceTransaction.php
··· 10 10 } 11 11 12 12 public function getApplicationTransactionType() { 13 - return PhabricatorPHIDConstants::PHID_TYPE_CONP; 13 + return PhabricatorConpherencePHIDTypeThread::TYPECONST; 14 14 } 15 15 16 16 public function getApplicationTransactionCommentObject() {
-1
src/applications/phid/PhabricatorPHIDConstants.php
··· 16 16 const PHID_TYPE_TOBJ = 'TOBJ'; 17 17 const PHID_TYPE_BLOG = 'BLOG'; 18 18 const PHID_TYPE_ANSW = 'ANSW'; 19 - const PHID_TYPE_CONP = 'CONP'; 20 19 const PHID_TYPE_ACNT = 'ACNT'; 21 20 const PHID_TYPE_PDCT = 'PDCT'; 22 21 const PHID_TYPE_PRCH = 'PRCH';
-30
src/applications/phid/handle/PhabricatorObjectHandleData.php
··· 104 104 ->execute(); 105 105 return mpull($posts, null, 'getPHID'); 106 106 107 - case PhabricatorPHIDConstants::PHID_TYPE_CONP: 108 - $confs = id(new ConpherenceThreadQuery()) 109 - ->withPHIDs($phids) 110 - ->setViewer($this->viewer) 111 - ->execute(); 112 - return mpull($confs, null, 'getPHID'); 113 - 114 107 } 115 108 116 109 return array(); ··· 264 257 $handles[$phid] = $handle; 265 258 } 266 259 break; 267 - 268 - case PhabricatorPHIDConstants::PHID_TYPE_CONP: 269 - foreach ($phids as $phid) { 270 - $handle = new PhabricatorObjectHandle(); 271 - $handle->setPHID($phid); 272 - $handle->setType($type); 273 - if (empty($objects[$phid])) { 274 - $handle->setName(pht('Unknown Conpherence Thread')); 275 - } else { 276 - $thread = $objects[$phid]; 277 - $name = $thread->getTitle(); 278 - if (!strlen($name)) { 279 - $name = pht('[No Title]'); 280 - } 281 - $handle->setName($name); 282 - $handle->setFullName($name); 283 - $handle->setURI('/conpherence/'.$thread->getID().'/'); 284 - $handle->setComplete(true); 285 - } 286 - $handles[$phid] = $handle; 287 - } 288 - break; 289 - 290 260 291 261 default: 292 262 foreach ($phids as $phid) {
-1
src/infrastructure/edges/constants/PhabricatorEdgeConfig.php
··· 159 159 PhabricatorPHIDConstants::PHID_TYPE_BLOG => 'PhameBlog', 160 160 PhabricatorPHIDConstants::PHID_TYPE_POST => 'PhamePost', 161 161 PhabricatorPHIDConstants::PHID_TYPE_ANSW => 'PonderAnswer', 162 - PhabricatorPHIDConstants::PHID_TYPE_CONP => 'ConpherenceThread', 163 162 PhabricatorPHIDConstants::PHID_TYPE_ACNT => 'PhortuneAccount', 164 163 PhabricatorPHIDConstants::PHID_TYPE_PRCH => 'PhortunePurchase', 165 164 PhabricatorPHIDConstants::PHID_TYPE_CHRG => 'PhortuneCharge',