@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 PhamePost to new phid stuff

Summary: Ref T2715

Test Plan: phid.query and a brief phame post read

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2715

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

+48 -29
+2
src/__phutil_library_map__.php
··· 1383 1383 'PhabricatorPeopleTestDataGenerator' => 'applications/people/lipsum/PhabricatorPeopleTestDataGenerator.php', 1384 1384 'PhabricatorPhameConfigOptions' => 'applications/phame/config/PhabricatorPhameConfigOptions.php', 1385 1385 'PhabricatorPhamePHIDTypeBlog' => 'applications/phame/phid/PhabricatorPhamePHIDTypeBlog.php', 1386 + 'PhabricatorPhamePHIDTypePost' => 'applications/phame/phid/PhabricatorPhamePHIDTypePost.php', 1386 1387 'PhabricatorPholioConfigOptions' => 'applications/pholio/config/PhabricatorPholioConfigOptions.php', 1387 1388 'PhabricatorPholioMockTestDataGenerator' => 'applications/pholio/lipsum/PhabricatorPholioMockTestDataGenerator.php', 1388 1389 'PhabricatorPhortuneConfigOptions' => 'applications/phortune/option/PhabricatorPhortuneConfigOptions.php', ··· 3417 3418 'PhabricatorPeopleTestDataGenerator' => 'PhabricatorTestDataGenerator', 3418 3419 'PhabricatorPhameConfigOptions' => 'PhabricatorApplicationConfigOptions', 3419 3420 'PhabricatorPhamePHIDTypeBlog' => 'PhabricatorPHIDType', 3421 + 'PhabricatorPhamePHIDTypePost' => 'PhabricatorPHIDType', 3420 3422 'PhabricatorPholioConfigOptions' => 'PhabricatorApplicationConfigOptions', 3421 3423 'PhabricatorPholioMockTestDataGenerator' => 'PhabricatorTestDataGenerator', 3422 3424 'PhabricatorPhortuneConfigOptions' => 'PhabricatorApplicationConfigOptions',
+45
src/applications/phame/phid/PhabricatorPhamePHIDTypePost.php
··· 1 + <?php 2 + 3 + /** 4 + * @group phame 5 + */ 6 + final class PhabricatorPhamePHIDTypePost extends PhabricatorPHIDType { 7 + 8 + const TYPECONST = 'POST'; 9 + 10 + public function getTypeConstant() { 11 + return self::TYPECONST; 12 + } 13 + 14 + public function getTypeName() { 15 + return pht('Phame Post'); 16 + } 17 + 18 + public function newObject() { 19 + return new PhamePost(); 20 + } 21 + 22 + public function loadObjects( 23 + PhabricatorObjectQuery $query, 24 + array $phids) { 25 + 26 + return id(new PhamePostQuery()) 27 + ->setViewer($query->getViewer()) 28 + ->withPHIDs($phids) 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 + $post = $objects[$phid]; 39 + $handle->setName($post->getTitle()); 40 + $handle->setFullName($post->getTitle()); 41 + $handle->setURI('/phame/post/view/'.$post->getID().'/'); 42 + } 43 + } 44 + 45 + }
+1 -1
src/applications/phame/storage/PhamePost.php
··· 81 81 82 82 public function generatePHID() { 83 83 return PhabricatorPHID::generateNewPHID( 84 - PhabricatorPHIDConstants::PHID_TYPE_POST); 84 + PhabricatorPhamePHIDTypePost::TYPECONST); 85 85 } 86 86 87 87 public static function getVisibilityOptionsForSelect() {
-1
src/applications/phid/PhabricatorObjectHandle.php
··· 109 109 110 110 static $map = array( 111 111 PhabricatorPHIDConstants::PHID_TYPE_USER => 'User', 112 - PhabricatorPHIDConstants::PHID_TYPE_POST => 'Post', 113 112 ); 114 113 115 114 return idx($map, $this->getType(), $this->getType());
-1
src/applications/phid/PhabricatorPHIDConstants.php
··· 12 12 const PHID_TYPE_DRYL = 'DRYL'; 13 13 const PHID_TYPE_OASC = 'OASC'; 14 14 const PHID_TYPE_OASA = 'OASA'; 15 - const PHID_TYPE_POST = 'POST'; 16 15 const PHID_TYPE_TOBJ = 'TOBJ'; 17 16 const PHID_TYPE_ANSW = 'ANSW'; 18 17 const PHID_TYPE_ACNT = 'ACNT';
-25
src/applications/phid/handle/PhabricatorObjectHandleData.php
··· 90 90 } 91 91 return mpull($xactions, null, 'getPHID'); 92 92 93 - case PhabricatorPHIDConstants::PHID_TYPE_POST: 94 - $posts = id(new PhamePostQuery()) 95 - ->withPHIDs($phids) 96 - ->setViewer($this->viewer) 97 - ->execute(); 98 - return mpull($posts, null, 'getPHID'); 99 - 100 93 } 101 94 102 95 return array(); ··· 209 202 } else { 210 203 $project = $objects[$phid]; 211 204 $handle->setName($project->getName()); 212 - $handle->setComplete(true); 213 - } 214 - $handles[$phid] = $handle; 215 - } 216 - break; 217 - 218 - case PhabricatorPHIDConstants::PHID_TYPE_POST: 219 - foreach ($phids as $phid) { 220 - $handle = new PhabricatorObjectHandle(); 221 - $handle->setPHID($phid); 222 - $handle->setType($type); 223 - if (empty($objects[$phid])) { 224 - $handle->setName('Unknown Post'); 225 - } else { 226 - $post = $objects[$phid]; 227 - $handle->setName($post->getTitle()); 228 - $handle->setFullName($post->getTitle()); 229 - $handle->setURI('/phame/post/view/'.$post->getID().'/'); 230 205 $handle->setComplete(true); 231 206 } 232 207 $handles[$phid] = $handle;
-1
src/infrastructure/edges/constants/PhabricatorEdgeConfig.php
··· 156 156 static $class_map = array( 157 157 PhabricatorPHIDConstants::PHID_TYPE_USER => 'PhabricatorUser', 158 158 PhabricatorPHIDConstants::PHID_TYPE_TOBJ => 'HarbormasterObject', 159 - PhabricatorPHIDConstants::PHID_TYPE_POST => 'PhamePost', 160 159 PhabricatorPHIDConstants::PHID_TYPE_ANSW => 'PonderAnswer', 161 160 PhabricatorPHIDConstants::PHID_TYPE_ACNT => 'PhortuneAccount', 162 161 PhabricatorPHIDConstants::PHID_TYPE_PRCH => 'PhortunePurchase',