mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-25 08:12:40 +01:00
855e085c6f
Summary: Fixes T2698. When applications are installed, their Conduit calls should drop out. This will also let us land Releeph without exposing Conduit calls. Test Plan: - Viewed Conduit console; uninstalled some applications and verified their calls dropped out. - Tried to make an uninstalled call; got an appropriate error. Reviewers: edward, btrahan Reviewed By: edward CC: aran Maniphest Tasks: T2698 Differential Revision: https://secure.phabricator.com/D5302
43 lines
1.1 KiB
PHP
43 lines
1.1 KiB
PHP
<?php
|
|
|
|
/**
|
|
* @group conduit
|
|
*/
|
|
abstract class ConduitAPI_project_Method extends ConduitAPIMethod {
|
|
|
|
public function getApplication() {
|
|
return PhabricatorApplication::getByClass(
|
|
'PhabricatorApplicationProject');
|
|
}
|
|
|
|
protected function buildProjectInfoDictionary(PhabricatorProject $project) {
|
|
$results = $this->buildProjectInfoDictionaries(array($project));
|
|
return idx($results, $project->getPHID());
|
|
}
|
|
|
|
protected function buildProjectInfoDictionaries(array $projects) {
|
|
assert_instances_of($projects, 'PhabricatorProject');
|
|
if (!$projects) {
|
|
return array();
|
|
}
|
|
|
|
$result = array();
|
|
foreach ($projects as $project) {
|
|
|
|
$member_phids = $project->getMemberPHIDs();
|
|
$member_phids = array_values($member_phids);
|
|
|
|
$result[$project->getPHID()] = array(
|
|
'id' => $project->getID(),
|
|
'phid' => $project->getPHID(),
|
|
'name' => $project->getName(),
|
|
'members' => $member_phids,
|
|
'dateCreated' => $project->getDateCreated(),
|
|
'dateModified' => $project->getDateModified(),
|
|
);
|
|
}
|
|
|
|
return $result;
|
|
}
|
|
|
|
}
|