diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 1383b5a4ea..c0873d286d 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -161,7 +161,6 @@ phutil_register_library_map(array( 'ConduitAPI_paste_Method' => 'applications/conduit/method/paste/ConduitAPI_paste_Method.php', 'ConduitAPI_paste_create_Method' => 'applications/conduit/method/paste/ConduitAPI_paste_create_Method.php', 'ConduitAPI_paste_info_Method' => 'applications/conduit/method/paste/ConduitAPI_paste_info_Method.php', - 'ConduitAPI_path_getowners_Method' => 'applications/conduit/method/path/ConduitAPI_path_getowners_Method.php', 'ConduitAPI_phid_Method' => 'applications/conduit/method/phid/ConduitAPI_phid_Method.php', 'ConduitAPI_phid_info_Method' => 'applications/conduit/method/phid/ConduitAPI_phid_info_Method.php', 'ConduitAPI_phid_lookup_Method' => 'applications/conduit/method/phid/ConduitAPI_phid_lookup_Method.php', @@ -1350,7 +1349,6 @@ phutil_register_library_map(array( 'ConduitAPI_paste_Method' => 'ConduitAPIMethod', 'ConduitAPI_paste_create_Method' => 'ConduitAPI_paste_Method', 'ConduitAPI_paste_info_Method' => 'ConduitAPI_paste_Method', - 'ConduitAPI_path_getowners_Method' => 'ConduitAPIMethod', 'ConduitAPI_phid_Method' => 'ConduitAPIMethod', 'ConduitAPI_phid_info_Method' => 'ConduitAPI_phid_Method', 'ConduitAPI_phid_lookup_Method' => 'ConduitAPI_phid_Method', diff --git a/src/applications/conduit/method/owners/ConduitAPI_owners_query_Method.php b/src/applications/conduit/method/owners/ConduitAPI_owners_query_Method.php index 5be79fae41..1174c77710 100644 --- a/src/applications/conduit/method/owners/ConduitAPI_owners_query_Method.php +++ b/src/applications/conduit/method/owners/ConduitAPI_owners_query_Method.php @@ -81,9 +81,7 @@ final class ConduitAPI_owners_query_Method return $packages; } - public static function queryByPath($repo_callsign, $path) { - // note: we call this from the deprecated path.getowners conduit call. - + private static function queryByPath($repo_callsign, $path) { $repository = id(new PhabricatorRepository())->loadOneWhere('callsign = %s', $repo_callsign); diff --git a/src/applications/conduit/method/path/ConduitAPI_path_getowners_Method.php b/src/applications/conduit/method/path/ConduitAPI_path_getowners_Method.php deleted file mode 100644 index f450a722c6..0000000000 --- a/src/applications/conduit/method/path/ConduitAPI_path_getowners_Method.php +++ /dev/null @@ -1,86 +0,0 @@ - 'required nonempty string', - 'path' => 'required nonempty string' - ); - } - - public function defineReturnType() { - return - "array(". - "array(". - "'phid' => phid, ". - "'name' => string, ". - "'primaryOwner' => phid, ". - "'owners' => array(phid)))"; - } - - public function defineErrorTypes() { - return array( - 'ERR_REP_NOT_FOUND' => 'The repository callsign is not recognized', - 'ERR_PATH_NOT_FOUND' => 'The specified path is not in any package', - ); - } - - protected function execute(ConduitAPIRequest $request) { - $packages = ConduitAPI_owners_query_Method::queryByPath( - $request->getValue('repositoryCallsign'), - $request->getValue('path') - ); - - if (empty($packages)) { - throw new ConduitException('ERR_PATH_NOT_FOUND'); - } - - $result = array(); - foreach ($packages as $package) { - $p_owners = - id(new PhabricatorOwnersOwner())->loadAllForPackages(array($package)); - - $result[] = array( - 'phid' => $package->getPHID(), - 'name' => $package->getName(), - 'primaryOwner' => $package->getPrimaryOwnerPHID(), - 'owners' => array_values(mpull($p_owners, 'getUserPHID')), - ); - } - - return $result; - } -}