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

Add "almanac.network.edit" and "almanac.network.search" API methods

Summary: Depends on D19334. Ref T13120. Ref T12414. These are pretty straightforward, but no one really has a use case for them anyway today so they're primarily just for completeness.

Test Plan:
- Queried networks with `almanac.network.search`.
- Created and edited networks with `almanac.network.edit`.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13120, T12414

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

+67 -1
+5
src/__phutil_library_map__.php
··· 104 104 'AlmanacNamespaceViewController' => 'applications/almanac/controller/AlmanacNamespaceViewController.php', 105 105 'AlmanacNetwork' => 'applications/almanac/storage/AlmanacNetwork.php', 106 106 'AlmanacNetworkController' => 'applications/almanac/controller/AlmanacNetworkController.php', 107 + 'AlmanacNetworkEditConduitAPIMethod' => 'applications/almanac/conduit/AlmanacNetworkEditConduitAPIMethod.php', 107 108 'AlmanacNetworkEditController' => 'applications/almanac/controller/AlmanacNetworkEditController.php', 108 109 'AlmanacNetworkEditEngine' => 'applications/almanac/editor/AlmanacNetworkEditEngine.php', 109 110 'AlmanacNetworkEditor' => 'applications/almanac/editor/AlmanacNetworkEditor.php', ··· 112 113 'AlmanacNetworkNameTransaction' => 'applications/almanac/xaction/AlmanacNetworkNameTransaction.php', 113 114 'AlmanacNetworkPHIDType' => 'applications/almanac/phid/AlmanacNetworkPHIDType.php', 114 115 'AlmanacNetworkQuery' => 'applications/almanac/query/AlmanacNetworkQuery.php', 116 + 'AlmanacNetworkSearchConduitAPIMethod' => 'applications/almanac/conduit/AlmanacNetworkSearchConduitAPIMethod.php', 115 117 'AlmanacNetworkSearchEngine' => 'applications/almanac/query/AlmanacNetworkSearchEngine.php', 116 118 'AlmanacNetworkTransaction' => 'applications/almanac/storage/AlmanacNetworkTransaction.php', 117 119 'AlmanacNetworkTransactionQuery' => 'applications/almanac/query/AlmanacNetworkTransactionQuery.php', ··· 5321 5323 'PhabricatorPolicyInterface', 5322 5324 'PhabricatorDestructibleInterface', 5323 5325 'PhabricatorNgramsInterface', 5326 + 'PhabricatorConduitResultInterface', 5324 5327 ), 5325 5328 'AlmanacNetworkController' => 'AlmanacController', 5329 + 'AlmanacNetworkEditConduitAPIMethod' => 'PhabricatorEditEngineAPIMethod', 5326 5330 'AlmanacNetworkEditController' => 'AlmanacNetworkController', 5327 5331 'AlmanacNetworkEditEngine' => 'PhabricatorEditEngine', 5328 5332 'AlmanacNetworkEditor' => 'AlmanacEditor', ··· 5331 5335 'AlmanacNetworkNameTransaction' => 'AlmanacNetworkTransactionType', 5332 5336 'AlmanacNetworkPHIDType' => 'PhabricatorPHIDType', 5333 5337 'AlmanacNetworkQuery' => 'AlmanacQuery', 5338 + 'AlmanacNetworkSearchConduitAPIMethod' => 'PhabricatorSearchEngineAPIMethod', 5334 5339 'AlmanacNetworkSearchEngine' => 'PhabricatorApplicationSearchEngine', 5335 5340 'AlmanacNetworkTransaction' => 'AlmanacModularTransaction', 5336 5341 'AlmanacNetworkTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
+19
src/applications/almanac/conduit/AlmanacNetworkEditConduitAPIMethod.php
··· 1 + <?php 2 + 3 + final class AlmanacNetworkEditConduitAPIMethod 4 + extends PhabricatorEditEngineAPIMethod { 5 + 6 + public function getAPIMethodName() { 7 + return 'almanac.network.edit'; 8 + } 9 + 10 + public function newEditEngine() { 11 + return new AlmanacNetworkEditEngine(); 12 + } 13 + 14 + public function getMethodSummary() { 15 + return pht( 16 + 'Apply transactions to create a new network or edit an existing one.'); 17 + } 18 + 19 + }
+18
src/applications/almanac/conduit/AlmanacNetworkSearchConduitAPIMethod.php
··· 1 + <?php 2 + 3 + final class AlmanacNetworkSearchConduitAPIMethod 4 + extends PhabricatorSearchEngineAPIMethod { 5 + 6 + public function getAPIMethodName() { 7 + return 'almanac.network.search'; 8 + } 9 + 10 + public function newSearchEngine() { 11 + return new AlmanacNetworkSearchEngine(); 12 + } 13 + 14 + public function getMethodSummary() { 15 + return pht('Read information about Almanac networks.'); 16 + } 17 + 18 + }
+25 -1
src/applications/almanac/storage/AlmanacNetwork.php
··· 6 6 PhabricatorApplicationTransactionInterface, 7 7 PhabricatorPolicyInterface, 8 8 PhabricatorDestructibleInterface, 9 - PhabricatorNgramsInterface { 9 + PhabricatorNgramsInterface, 10 + PhabricatorConduitResultInterface { 10 11 11 12 protected $name; 12 13 protected $mailKey; ··· 120 121 id(new AlmanacNetworkNameNgrams()) 121 122 ->setValue($this->getName()), 122 123 ); 124 + } 125 + 126 + 127 + /* -( PhabricatorConduitResultInterface )---------------------------------- */ 128 + 129 + 130 + public function getFieldSpecificationsForConduit() { 131 + return array( 132 + id(new PhabricatorConduitSearchFieldSpecification()) 133 + ->setKey('name') 134 + ->setType('string') 135 + ->setDescription(pht('The name of the network.')), 136 + ); 137 + } 138 + 139 + public function getFieldValuesForConduit() { 140 + return array( 141 + 'name' => $this->getName(), 142 + ); 143 + } 144 + 145 + public function getConduitSearchAttachments() { 146 + return array(); 123 147 } 124 148 125 149 }