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

Use application PHIDs for Diviner Books

Summary: Ref T2715.

Test Plan: `phid.query`

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2715

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

+48 -2
+2
src/__phutil_library_map__.php
··· 533 533 'DivinerLiveBook' => 'applications/diviner/storage/DivinerLiveBook.php', 534 534 'DivinerLivePublisher' => 'applications/diviner/publisher/DivinerLivePublisher.php', 535 535 'DivinerLiveSymbol' => 'applications/diviner/storage/DivinerLiveSymbol.php', 536 + 'DivinerPHIDTypeBook' => 'applications/diviner/phid/DivinerPHIDTypeBook.php', 536 537 'DivinerPublishCache' => 'applications/diviner/cache/DivinerPublishCache.php', 537 538 'DivinerPublisher' => 'applications/diviner/publisher/DivinerPublisher.php', 538 539 'DivinerRemarkupRuleSymbol' => 'applications/diviner/markup/DivinerRemarkupRuleSymbol.php', ··· 2536 2537 1 => 'PhabricatorPolicyInterface', 2537 2538 2 => 'PhabricatorMarkupInterface', 2538 2539 ), 2540 + 'DivinerPHIDTypeBook' => 'PhabricatorPHIDType', 2539 2541 'DivinerPublishCache' => 'DivinerDiskCache', 2540 2542 'DivinerRemarkupRuleSymbol' => 'PhutilRemarkupRule', 2541 2543 'DivinerStaticPublisher' => 'DivinerPublisher',
+45
src/applications/diviner/phid/DivinerPHIDTypeBook.php
··· 1 + <?php 2 + 3 + final class DivinerPHIDTypeBook extends PhabricatorPHIDType { 4 + 5 + const TYPECONST = 'BOOK'; 6 + 7 + public function getTypeConstant() { 8 + return self::TYPECONST; 9 + } 10 + 11 + public function getTypeName() { 12 + return pht('Book'); 13 + } 14 + 15 + public function newObject() { 16 + return new DivinerLiveBook(); 17 + } 18 + 19 + public function loadObjects( 20 + PhabricatorObjectQuery $query, 21 + array $phids) { 22 + 23 + return id(new DivinerBookQuery()) 24 + ->setViewer($query->getViewer()) 25 + ->withPHIDs($phids) 26 + ->execute(); 27 + } 28 + 29 + public function loadHandles( 30 + PhabricatorHandleQuery $query, 31 + array $handles, 32 + array $objects) { 33 + 34 + foreach ($handles as $phid => $handle) { 35 + $book = $objects[$phid]; 36 + 37 + $name = $book->getName(); 38 + 39 + $handle->setName($book->getShortTitle()); 40 + $handle->setFullName($book->getTitle()); 41 + $handle->setURI("/diviner/book/{$name}/"); 42 + } 43 + } 44 + 45 + }
+1 -1
src/applications/diviner/storage/DivinerLiveBook.php
··· 28 28 29 29 public function generatePHID() { 30 30 return PhabricatorPHID::generateNewPHID( 31 - PhabricatorPHIDConstants::PHID_TYPE_BOOK); 31 + DivinerPHIDTypeBook::TYPECONST); 32 32 } 33 33 34 34 public function getTitle() {
-1
src/applications/phid/PhabricatorPHIDConstants.php
··· 22 22 23 23 const PHID_TYPE_XCMT = 'XCMT'; 24 24 25 - const PHID_TYPE_BOOK = 'BOOK'; 26 25 const PHID_TYPE_ATOM = 'ATOM'; 27 26 const PHID_TYPE_AUTH = 'AUTH'; 28 27 const PHID_TYPE_XOBJ = 'XOBJ';