@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 phame.blog.search Conduit API endpoint

Summary: Ref T9897. Adds basic blog query support.

Test Plan: Ran some queries.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9897

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

+60 -1
+3
src/__phutil_library_map__.php
··· 3413 3413 'PhameBlogProfilePictureController' => 'applications/phame/controller/blog/PhameBlogProfilePictureController.php', 3414 3414 'PhameBlogQuery' => 'applications/phame/query/PhameBlogQuery.php', 3415 3415 'PhameBlogReplyHandler' => 'applications/phame/mail/PhameBlogReplyHandler.php', 3416 + 'PhameBlogSearchConduitAPIMethod' => 'applications/phame/conduit/PhameBlogSearchConduitAPIMethod.php', 3416 3417 'PhameBlogSearchEngine' => 'applications/phame/query/PhameBlogSearchEngine.php', 3417 3418 'PhameBlogSite' => 'applications/phame/site/PhameBlogSite.php', 3418 3419 'PhameBlogTransaction' => 'applications/phame/storage/PhameBlogTransaction.php', ··· 7846 7847 'PhabricatorProjectInterface', 7847 7848 'PhabricatorDestructibleInterface', 7848 7849 'PhabricatorApplicationTransactionInterface', 7850 + 'PhabricatorConduitResultInterface', 7849 7851 ), 7850 7852 'PhameBlogArchiveController' => 'PhameBlogController', 7851 7853 'PhameBlogController' => 'PhameController', ··· 7861 7863 'PhameBlogProfilePictureController' => 'PhameBlogController', 7862 7864 'PhameBlogQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 7863 7865 'PhameBlogReplyHandler' => 'PhabricatorApplicationTransactionReplyHandler', 7866 + 'PhameBlogSearchConduitAPIMethod' => 'PhabricatorSearchEngineAPIMethod', 7864 7867 'PhameBlogSearchEngine' => 'PhabricatorApplicationSearchEngine', 7865 7868 'PhameBlogSite' => 'PhameSite', 7866 7869 'PhameBlogTransaction' => 'PhabricatorApplicationTransaction',
+18
src/applications/phame/conduit/PhameBlogSearchConduitAPIMethod.php
··· 1 + <?php 2 + 3 + final class PhameBlogSearchConduitAPIMethod 4 + extends PhabricatorSearchEngineAPIMethod { 5 + 6 + public function getAPIMethodName() { 7 + return 'phame.blog.search'; 8 + } 9 + 10 + public function newSearchEngine() { 11 + return new PhameBlogSearchEngine(); 12 + } 13 + 14 + public function getMethodSummary() { 15 + return pht('Read information about blogs.'); 16 + } 17 + 18 + }
+35 -1
src/applications/phame/storage/PhameBlog.php
··· 8 8 PhabricatorFlaggableInterface, 9 9 PhabricatorProjectInterface, 10 10 PhabricatorDestructibleInterface, 11 - PhabricatorApplicationTransactionInterface { 11 + PhabricatorApplicationTransactionInterface, 12 + PhabricatorConduitResultInterface { 12 13 13 14 const MARKUP_FIELD_DESCRIPTION = 'markup:description'; 14 15 ··· 341 342 342 343 public function shouldAllowSubscription($phid) { 343 344 return true; 345 + } 346 + 347 + 348 + /* -( PhabricatorConduitResultInterface )---------------------------------- */ 349 + 350 + 351 + public function getFieldSpecificationsForConduit() { 352 + return array( 353 + id(new PhabricatorConduitSearchFieldSpecification()) 354 + ->setKey('name') 355 + ->setType('string') 356 + ->setDescription(pht('The name of the blog.')), 357 + id(new PhabricatorConduitSearchFieldSpecification()) 358 + ->setKey('description') 359 + ->setType('string') 360 + ->setDescription(pht('Blog description.')), 361 + id(new PhabricatorConduitSearchFieldSpecification()) 362 + ->setKey('status') 363 + ->setType('string') 364 + ->setDescription(pht('Archived or active status.')), 365 + ); 366 + } 367 + 368 + public function getFieldValuesForConduit() { 369 + return array( 370 + 'name' => $this->getName(), 371 + 'description' => $this->getDescription(), 372 + 'status' => $this->getStatus(), 373 + ); 374 + } 375 + 376 + public function getConduitSearchAttachments() { 377 + return array(); 344 378 } 345 379 346 380
+4
src/applications/search/engine/PhabricatorSearchEngineAPIMethod.php
··· 15 15 } 16 16 } 17 17 18 + if (!$maps) { 19 + $maps = (object)$maps; 20 + } 21 + 18 22 return $maps; 19 23 } 20 24