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

Deprecate `user.find`

Summary: Super old method which is completely obsoleted by `user.query`

Test Plan: Poked around web UI, ran method.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

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

+14 -9
+14 -9
src/applications/people/conduit/ConduitAPI_user_find_Method.php
··· 1 1 <?php 2 2 3 - /** 4 - * @group conduit 5 - */ 6 3 final class ConduitAPI_user_find_Method 7 4 extends ConduitAPI_user_Method { 8 5 6 + public function getMethodStatus() { 7 + return self::METHOD_STATUS_DEPRECATED; 8 + } 9 + 10 + public function getMethodStatusDescription() { 11 + return pht('Obsoleted by "user.query".'); 12 + } 13 + 9 14 public function getMethodDescription() { 10 - return "Find user PHIDs which correspond to provided user aliases. ". 11 - "Returns NULL for aliases which do have any corresponding PHIDs."; 15 + return pht('Lookup PHIDs by username. Obsoleted by "user.query".'); 12 16 } 13 17 14 18 public function defineParamTypes() { 15 19 return array( 16 - 'aliases' => 'required nonempty list<string>' 20 + 'aliases' => 'required list<string>' 17 21 ); 18 22 } 19 23 ··· 27 31 } 28 32 29 33 protected function execute(ConduitAPIRequest $request) { 30 - $users = id(new PhabricatorUser())->loadAllWhere( 31 - 'username in (%Ls)', 32 - $request->getValue('aliases')); 34 + $users = id(new PhabricatorPeopleQuery()) 35 + ->setViewer($request->getUser()) 36 + ->withUsernames($request->getValue('aliases', array())) 37 + ->execute(); 33 38 34 39 return mpull($users, 'getPHID', 'getUsername'); 35 40 }