1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-25 16:22:43 +01:00

Rename Conduit classes

Summary: Ref T5655. Rename Conduit classes and provide a `getAPIMethodName` method to declare the API method.

Test Plan:
```
> echo '{}' | arc --conduit-uri='http://phabricator.joshuaspence.com' call-conduit user.whoami
Waiting for JSON parameters on stdin...
{"error":null,"errorMessage":null,"response":{"phid":"PHID-USER-lioqffnwn6y475mu5ndb","userName":"josh","realName":"Joshua Spence","image":"http:\/\/phabricator.joshuaspence.com\/res\/1404425321T\/phabricator\/3eb28cd9\/rsrc\/image\/avatar.png","uri":"http:\/\/phabricator.joshuaspence.com\/p\/josh\/","roles":["admin","verified","approved","activated"]}}
```

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin, hach-que

Maniphest Tasks: T5655

Differential Revision: https://secure.phabricator.com/D9991
This commit is contained in:
Joshua Spence 2014-07-25 10:54:15 +10:00
parent b4d7a9de39
commit 023dee0d3b
175 changed files with 1224 additions and 765 deletions

View file

@ -78,7 +78,6 @@
"16": "advice", "16": "advice",
"34": "error" "34": "error"
}, },
"xhpast.naminghook": "PhabricatorSymbolNameLinter",
"xhpast.php-version": "5.2.3", "xhpast.php-version": "5.2.3",
"xhpast.php-version.windows": "5.3.0" "xhpast.php-version.windows": "5.3.0"
} }

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,3 @@
<?php
abstract class ArcanistConduitAPIMethod extends ConduitAPIMethod {}

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_arcanist_projectinfo_Method final class ArcanistProjectInfoConduitAPIMethod
extends ConduitAPI_arcanist_Method { extends ArcanistConduitAPIMethod {
public function getAPIMethodName() {
return 'arcanist.projectinfo';
}
public function getMethodDescription() { public function getMethodDescription() {
return 'Get information about Arcanist projects.'; return 'Get information about Arcanist projects.';

View file

@ -1,3 +0,0 @@
<?php
abstract class ConduitAPI_arcanist_Method extends ConduitAPIMethod {}

View file

@ -0,0 +1,9 @@
<?php
abstract class AuditConduitAPIMethod extends ConduitAPIMethod {
final public function getApplication() {
return PhabricatorApplication::getByClass('PhabricatorApplicationAudit');
}
}

View file

@ -1,6 +1,10 @@
<?php <?php
final class ConduitAPI_audit_query_Method extends ConduitAPI_audit_Method { final class AuditQueryConduitAPIMethod extends AuditConduitAPIMethod {
public function getAPIMethodName() {
return 'audit.query';
}
public function getMethodDescription() { public function getMethodDescription() {
return 'Query audit requests.'; return 'Query audit requests.';

View file

@ -1,9 +0,0 @@
<?php
abstract class ConduitAPI_audit_Method extends ConduitAPIMethod {
public function getApplication() {
return PhabricatorApplication::getByClass('PhabricatorAuditApplication');
}
}

View file

@ -0,0 +1,9 @@
<?php
abstract class ChatLogConduitAPIMethod extends ConduitAPIMethod {
final public function getApplication() {
return PhabricatorApplication::getByClass('PhabricatorApplicationChatLog');
}
}

View file

@ -1,6 +1,10 @@
<?php <?php
final class ConduitAPI_chatlog_query_Method extends ConduitAPI_chatlog_Method { final class ChatLogQueryConduitAPIMethod extends ChatLogConduitAPIMethod {
public function getAPIMethodName() {
return 'chatlog.query';
}
public function getMethodStatus() { public function getMethodStatus() {
return self::METHOD_STATUS_UNSTABLE; return self::METHOD_STATUS_UNSTABLE;

View file

@ -1,6 +1,10 @@
<?php <?php
final class ConduitAPI_chatlog_record_Method extends ConduitAPI_chatlog_Method { final class ChatLogRecordConduitAPIMethod extends ChatLogConduitAPIMethod {
public function getAPIMethodName() {
return 'chatlog.record';
}
public function getMethodStatus() { public function getMethodStatus() {
return self::METHOD_STATUS_UNSTABLE; return self::METHOD_STATUS_UNSTABLE;

View file

@ -1,9 +0,0 @@
<?php
abstract class ConduitAPI_chatlog_Method extends ConduitAPIMethod {
public function getApplication() {
return PhabricatorApplication::getByClass('PhabricatorChatLogApplication');
}
}

View file

@ -168,41 +168,19 @@ final class ConduitCall {
return $servers[array_rand($servers)]; return $servers[array_rand($servers)];
} }
protected function buildMethodHandler($method) { protected function buildMethodHandler($method_name) {
$method_class = ConduitAPIMethod::getClassNameFromAPIMethodName($method); $method = ConduitAPIMethod::getConduitMethod($method_name);
// Test if the method exists. if (!$method) {
$ok = false;
try {
$ok = class_exists($method_class);
} catch (Exception $ex) {
// Discard, we provide a more specific exception below.
}
if (!$ok) {
throw new ConduitException( throw new ConduitException(
"Conduit method '{$method}' does not exist."); "Conduit method '{$method_name}' does not exist.");
}
$class_info = new ReflectionClass($method_class);
if ($class_info->isAbstract()) {
throw new ConduitException(
"Method '{$method}' is not valid; the implementation is an abstract ".
"base class.");
}
$method = newv($method_class, array());
if (!($method instanceof ConduitAPIMethod)) {
throw new ConduitException(
"Method '{$method_class}' is not valid; the implementation must be ".
"a subclass of ConduitAPIMethod.");
} }
$application = $method->getApplication(); $application = $method->getApplication();
if ($application && !$application->isInstalled()) { if ($application && !$application->isInstalled()) {
$app_name = $application->getName(); $app_name = $application->getName();
throw new ConduitException( throw new ConduitException(
"Method '{$method_class}' belongs to application '{$app_name}', ". "Method '{$method_name}' belongs to application '{$app_name}', ".
"which is not installed."); "which is not installed.");
} }

View file

@ -18,9 +18,7 @@ abstract class ConduitAPIMethod
abstract public function defineErrorTypes(); abstract public function defineErrorTypes();
abstract protected function execute(ConduitAPIRequest $request); abstract protected function execute(ConduitAPIRequest $request);
public function __construct() { public function __construct() {}
}
/** /**
* This is mostly for compatibility with * This is mostly for compatibility with
@ -67,9 +65,7 @@ abstract class ConduitAPIMethod
return $this->execute($request); return $this->execute($request);
} }
public function getAPIMethodName() { public abstract function getAPIMethodName();
return self::getAPIMethodNameFromClassName(get_class($this));
}
/** /**
* Return a key which sorts methods by application name, then method status, * Return a key which sorts methods by application name, then method status,
@ -94,9 +90,33 @@ abstract class ConduitAPIMethod
return head(explode('.', $this->getAPIMethodName(), 2)); return head(explode('.', $this->getAPIMethodName(), 2));
} }
public static function getClassNameFromAPIMethodName($method_name) { public static function getConduitMethod($method_name) {
$method_fragment = str_replace('.', '_', $method_name); static $method_map = null;
return 'ConduitAPI_'.$method_fragment.'_Method';
if ($method_map === null) {
$methods = id(new PhutilSymbolLoader())
->setAncestorClass(__CLASS__)
->setConcreteOnly(true)
->loadObjects();
foreach ($methods as $method) {
$name = $method->getAPIMethodName();
if (empty($method_map[$name])) {
$method_map[$name] = $method;
continue;
}
$orig_class = get_class($method_map[$name]);
$this_class = get_class($method);
throw new Exception(
"Two Conduit API method classes ({$orig_class}, {$this_class}) ".
"both have the same method name ({$name}). API methods ".
"must have unique method names.");
}
}
return idx($method_map, $method_name);
} }
public function shouldRequireAuthentication() { public function shouldRequireAuthentication() {
@ -122,20 +142,6 @@ abstract class ConduitAPIMethod
return null; return null;
} }
public static function getAPIMethodNameFromClassName($class_name) {
$match = null;
$is_valid = preg_match(
'/^ConduitAPI_(.*)_Method$/',
$class_name,
$match);
if (!$is_valid) {
throw new Exception(
"Parameter '{$class_name}' is not a valid Conduit API method class.");
}
$method_fragment = $match[1];
return str_replace('_', '.', $method_fragment);
}
protected function formatStringConstants($constants) { protected function formatStringConstants($constants) {
foreach ($constants as $key => $value) { foreach ($constants as $key => $value) {
$constants[$key] = '"'.$value.'"'; $constants[$key] = '"'.$value.'"';
@ -153,9 +159,9 @@ abstract class ConduitAPIMethod
*/ */
protected function getPagerParamTypes() { protected function getPagerParamTypes() {
return array( return array(
'before' => 'optional string', 'before' => 'optional string',
'after' => 'optional string', 'after' => 'optional string',
'limit' => 'optional int (default = 100)', 'limit' => 'optional int (default = 100)',
); );
} }
@ -229,7 +235,7 @@ abstract class ConduitAPIMethod
public function hasAutomaticCapability($capability, PhabricatorUser $viewer) { public function hasAutomaticCapability($capability, PhabricatorUser $viewer) {
if (!$this->shouldRequireAuthentication()) { if (!$this->shouldRequireAuthentication()) {
// Make unauthenticated methods univerally visible. // Make unauthenticated methods universally visible.
return true; return true;
} }
@ -240,5 +246,4 @@ abstract class ConduitAPIMethod
return null; return null;
} }
} }

View file

@ -1,6 +1,10 @@
<?php <?php
final class ConduitAPI_conduit_connect_Method extends ConduitAPIMethod { final class ConduitConnectConduitAPIMethod extends ConduitAPIMethod {
public function getAPIMethodName() {
return 'conduit.connect';
}
public function shouldRequireAuthentication() { public function shouldRequireAuthentication() {
return false; return false;

View file

@ -1,6 +1,10 @@
<?php <?php
final class ConduitAPI_conduit_getcertificate_Method extends ConduitAPIMethod { final class ConduitGetCertificateConduitAPIMethod extends ConduitAPIMethod {
public function getAPIMethodName() {
return 'conduit.getcertificate';
}
public function shouldRequireAuthentication() { public function shouldRequireAuthentication() {
return false; return false;

View file

@ -1,6 +1,10 @@
<?php <?php
final class ConduitAPI_conduit_ping_Method extends ConduitAPIMethod { final class ConduitPingConduitAPIMethod extends ConduitAPIMethod {
public function getAPIMethodName() {
return 'conduit.ping';
}
public function shouldRequireAuthentication() { public function shouldRequireAuthentication() {
return false; return false;

View file

@ -1,6 +1,10 @@
<?php <?php
final class ConduitAPI_conduit_query_Method extends ConduitAPIMethod { final class ConduitQueryConduitAPIMethod extends ConduitAPIMethod {
public function getAPIMethodName() {
return 'conduit.query';
}
public function getMethodDescription() { public function getMethodDescription() {
return 'Returns the parameters of the Conduit methods.'; return 'Returns the parameters of the Conduit methods.';

View file

@ -1,8 +1,8 @@
<?php <?php
abstract class ConduitAPI_conpherence_Method extends ConduitAPIMethod { abstract class ConpherenceConduitAPIMethod extends ConduitAPIMethod {
public function getApplication() { final public function getApplication() {
return PhabricatorApplication::getByClass( return PhabricatorApplication::getByClass(
'PhabricatorConpherenceApplication'); 'PhabricatorConpherenceApplication');
} }

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_conpherence_createthread_Method final class ConpherenceCreateThreadConduitAPIMethod
extends ConduitAPI_conpherence_Method { extends ConpherenceConduitAPIMethod {
public function getAPIMethodName() {
return 'conpherence.createthread';
}
public function getMethodDescription() { public function getMethodDescription() {
return pht('Create a new conpherence thread.'); return pht('Create a new conpherence thread.');

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_conpherence_querythread_Method final class ConpherenceQueryThreadConduitAPIMethod
extends ConduitAPI_conpherence_Method { extends ConpherenceConduitAPIMethod {
public function getAPIMethodName() {
return 'conpherence.querythread';
}
public function getMethodDescription() { public function getMethodDescription() {
return pht( return pht(

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_conpherence_querytransaction_Method final class ConpherenceQueryTransactionConduitAPIMethod
extends ConduitAPI_conpherence_Method { extends ConpherenceConduitAPIMethod {
public function getAPIMethodName() {
return 'conpherence.querytransaction';
}
public function getMethodDescription() { public function getMethodDescription() {
return pht( return pht(

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_conpherence_updatethread_Method final class ConpherenceUpdateThreadConduitAPIMethod
extends ConduitAPI_conpherence_Method { extends ConpherenceConduitAPIMethod {
public function getAPIMethodName() {
return 'conpherence.updatethread';
}
public function getMethodDescription() { public function getMethodDescription() {
return pht('Update an existing conpherence thread.'); return pht('Update an existing conpherence thread.');

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_differential_close_Method final class DifferentialCloseConduitAPIMethod
extends ConduitAPI_differential_Method { extends DifferentialConduitAPIMethod {
public function getAPIMethodName() {
return 'differential.close';
}
public function getMethodDescription() { public function getMethodDescription() {
return pht('Close a Differential revision.'); return pht('Close a Differential revision.');

View file

@ -1,8 +1,8 @@
<?php <?php
abstract class ConduitAPI_differential_Method extends ConduitAPIMethod { abstract class DifferentialConduitAPIMethod extends ConduitAPIMethod {
public function getApplication() { final public function getApplication() {
return PhabricatorApplication::getByClass( return PhabricatorApplication::getByClass(
'PhabricatorDifferentialApplication'); 'PhabricatorDifferentialApplication');
} }

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_differential_createcomment_Method final class DifferentialCreateCommentConduitAPIMethod
extends ConduitAPI_differential_Method { extends DifferentialConduitAPIMethod {
public function getAPIMethodName() {
return 'differential.createcomment';
}
public function getMethodDescription() { public function getMethodDescription() {
return pht('Add a comment to a Differential revision.'); return pht('Add a comment to a Differential revision.');

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_differential_creatediff_Method final class DifferentialCreateDiffConduitAPIMethod
extends ConduitAPI_differential_Method { extends DifferentialConduitAPIMethod {
public function getAPIMethodName() {
return 'differential.creatediff';
}
public function getMethodDescription() { public function getMethodDescription() {
return 'Create a new Differential diff.'; return 'Create a new Differential diff.';

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_differential_createinline_Method final class DifferentialCreateInlineConduitAPIMethod
extends ConduitAPI_differential_Method { extends DifferentialConduitAPIMethod {
public function getAPIMethodName() {
return 'differential.createinline';
}
public function getMethodDescription() { public function getMethodDescription() {
return 'Add an inline comment to a Differential revision.'; return 'Add an inline comment to a Differential revision.';

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_differential_createrawdiff_Method final class DifferentialCreateRawDiffConduitAPIMethod
extends ConduitAPI_differential_Method { extends DifferentialConduitAPIMethod {
public function getAPIMethodName() {
return 'differential.createrawdiff';
}
public function getMethodDescription() { public function getMethodDescription() {
return pht('Create a new Differential diff from a raw diff source.'); return pht('Create a new Differential diff from a raw diff source.');

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_differential_createrevision_Method final class DifferentialCreateRevisionConduitAPIMethod
extends ConduitAPI_differential_Method { extends DifferentialConduitAPIMethod {
public function getAPIMethodName() {
return 'differential.createrevision';
}
public function getMethodDescription() { public function getMethodDescription() {
return pht('Create a new Differential revision.'); return pht('Create a new Differential revision.');

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_differential_find_Method final class DifferentialFindConduitAPIMethod
extends ConduitAPI_differential_Method { extends DifferentialConduitAPIMethod {
public function getAPIMethodName() {
return 'differential.find';
}
public function getMethodStatus() { public function getMethodStatus() {
return self::METHOD_STATUS_DEPRECATED; return self::METHOD_STATUS_DEPRECATED;

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_differential_finishpostponedlinters_Method final class DifferentialFinishPostponedLintersConduitAPIMethod
extends ConduitAPI_differential_Method { extends DifferentialConduitAPIMethod {
public function getAPIMethodName() {
return 'differential.finishpostponedlinters';
}
public function getMethodDescription() { public function getMethodDescription() {
return 'Update diff with new lint messages and mark postponed '. return 'Update diff with new lint messages and mark postponed '.

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_differential_getalldiffs_Method final class DifferentialGetAllDiffsConduitAPIMethod
extends ConduitAPI_differential_Method { extends DifferentialConduitAPIMethod {
public function getAPIMethodName() {
return 'differential.getalldiffs';
}
public function getMethodStatus() { public function getMethodStatus() {
return self::METHOD_STATUS_DEPRECATED; return self::METHOD_STATUS_DEPRECATED;
@ -52,4 +56,5 @@ final class ConduitAPI_differential_getalldiffs_Method
return $results; return $results;
} }
} }

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_differential_getcommitmessage_Method final class DifferentialGetCommitMessageConduitAPIMethod
extends ConduitAPI_differential_Method { extends DifferentialConduitAPIMethod {
public function getAPIMethodName() {
return 'differential.getcommitmessage';
}
public function getMethodDescription() { public function getMethodDescription() {
return 'Retrieve Differential commit messages or message templates.'; return 'Retrieve Differential commit messages or message templates.';

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_differential_getcommitpaths_Method final class DifferentialGetCommitPathsConduitAPIMethod
extends ConduitAPI_differential_Method { extends DifferentialConduitAPIMethod {
public function getAPIMethodName() {
return 'differential.getcommitpaths';
}
public function getMethodDescription() { public function getMethodDescription() {
return 'Query which paths should be included when committing a '. return 'Query which paths should be included when committing a '.

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_differential_getdiff_Method final class DifferentialGetDiffConduitAPIMethod
extends ConduitAPI_differential_Method { extends DifferentialConduitAPIMethod {
public function getAPIMethodName() {
return 'differential.getdiff';
}
public function shouldAllowPublic() { public function shouldAllowPublic() {
return true; return true;

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_differential_getrawdiff_Method final class DifferentialGetRawDiffConduitAPIMethod
extends ConduitAPI_differential_Method { extends DifferentialConduitAPIMethod {
public function getAPIMethodName() {
return 'differential.getrawdiff';
}
public function getMethodDescription() { public function getMethodDescription() {
return pht('Retrieve a raw diff'); return pht('Retrieve a raw diff');

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_differential_getrevisioncomments_Method final class DifferentialGetRevisionCommentsConduitAPIMethod
extends ConduitAPI_differential_Method { extends DifferentialConduitAPIMethod {
public function getAPIMethodName() {
return 'differential.getrevisioncomments';
}
public function getMethodStatus() { public function getMethodStatus() {
return self::METHOD_STATUS_DEPRECATED; return self::METHOD_STATUS_DEPRECATED;
@ -86,4 +90,5 @@ final class ConduitAPI_differential_getrevisioncomments_Method
return $results; return $results;
} }
} }

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_differential_getrevision_Method final class DifferentialGetRevisionConduitAPIMethod
extends ConduitAPI_differential_Method { extends DifferentialConduitAPIMethod {
public function getAPIMethodName() {
return 'differential.getrevision';
}
public function getMethodStatus() { public function getMethodStatus() {
return self::METHOD_STATUS_DEPRECATED; return self::METHOD_STATUS_DEPRECATED;

View file

@ -1,10 +1,14 @@
<?php <?php
final class ConduitAPI_differential_parsecommitmessage_Method final class DifferentialParseCommitMessageConduitAPIMethod
extends ConduitAPI_differential_Method { extends DifferentialConduitAPIMethod {
private $errors; private $errors;
public function getAPIMethodName() {
return 'differential.parsecommitmessage';
}
public function getMethodDescription() { public function getMethodDescription() {
return pht('Parse commit messages for Differential fields.'); return pht('Parse commit messages for Differential fields.');
} }
@ -128,5 +132,4 @@ final class ConduitAPI_differential_parsecommitmessage_Method
return $result; return $result;
} }
} }

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_differential_query_Method final class DifferentialQueryConduitAPIMethod
extends ConduitAPI_differential_Method { extends DifferentialConduitAPIMethod {
public function getAPIMethodName() {
return 'differential.query';
}
public function getMethodDescription() { public function getMethodDescription() {
return 'Query Differential revisions which match certain criteria.'; return 'Query Differential revisions which match certain criteria.';

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_differential_querydiffs_Method final class DifferentialQueryDiffsConduitAPIMethod
extends ConduitAPI_differential_Method { extends DifferentialConduitAPIMethod {
public function getAPIMethodName() {
return 'differential.querydiffs';
}
public function getMethodDescription() { public function getMethodDescription() {
return pht('Query differential diffs which match certain criteria.'); return pht('Query differential diffs which match certain criteria.');
@ -39,4 +43,5 @@ final class ConduitAPI_differential_querydiffs_Method
return mpull($diffs, 'getDiffDict', 'getID'); return mpull($diffs, 'getDiffDict', 'getID');
} }
} }

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_differential_setdiffproperty_Method final class DifferentialSetDiffPropertyConduitAPIMethod
extends ConduitAPI_differential_Method { extends DifferentialConduitAPIMethod {
public function getAPIMethodName() {
return 'differential.setdiffproperty';
}
public function getMethodDescription() { public function getMethodDescription() {
return 'Attach properties to Differential diffs.'; return 'Attach properties to Differential diffs.';
@ -107,4 +111,5 @@ final class ConduitAPI_differential_setdiffproperty_Method
$property->save(); $property->save();
return $property; return $property;
} }
} }

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_differential_updaterevision_Method final class DifferentialUpdateRevisionConduitAPIMethod
extends ConduitAPI_differential_Method { extends DifferentialConduitAPIMethod {
public function getAPIMethodName() {
return 'differential.updaterevision';
}
public function getMethodDescription() { public function getMethodDescription() {
return pht('Update a Differential revision.'); return pht('Update a Differential revision.');

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_differential_updateunitresults_Method final class DifferentialUpdateUnitResultsConduitAPIMethod
extends ConduitAPI_differential_Method { extends DifferentialConduitAPIMethod {
public function getAPIMethodName() {
return 'differential.updateunitresults';
}
public function getMethodDescription() { public function getMethodDescription() {
return 'Update arc unit results for a postponed test.'; return 'Update arc unit results for a postponed test.';
@ -145,4 +149,5 @@ final class ConduitAPI_differential_updateunitresults_Method
$diff->setUnitStatus($final_diff_status); $diff->setUnitStatus($final_diff_status);
$diff->save(); $diff->save();
} }
} }

View file

@ -1,10 +0,0 @@
<?php
abstract class ConduitAPI_diffusion_Method extends ConduitAPIMethod {
public function getApplication() {
return PhabricatorApplication::getByClass(
'PhabricatorDiffusionApplication');
}
}

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_diffusion_branchquery_Method final class DiffusionBranchQueryConduitAPIMethod
extends ConduitAPI_diffusion_abstractquery_Method { extends DiffusionQueryConduitAPIMethod {
public function getAPIMethodName() {
return 'diffusion.branchquery';
}
public function getMethodDescription() { public function getMethodDescription() {
return pht('Determine what branches exist for a repository.'); return pht('Determine what branches exist for a repository.');

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_diffusion_browsequery_Method final class DiffusionBrowseQueryConduitAPIMethod
extends ConduitAPI_diffusion_abstractquery_Method { extends DiffusionQueryConduitAPIMethod {
public function getAPIMethodName() {
return 'diffusion.browsequery';
}
public function getMethodDescription() { public function getMethodDescription() {
return return

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_diffusion_commitparentsquery_Method final class DiffusionCommitParentsQueryConduitAPIMethod
extends ConduitAPI_diffusion_abstractquery_Method { extends DiffusionQueryConduitAPIMethod {
public function getAPIMethodName() {
return 'diffusion.commitparentsquery';
}
public function getMethodDescription() { public function getMethodDescription() {
return pht( return pht(

View file

@ -0,0 +1,10 @@
<?php
abstract class DiffusionConduitAPIMethod extends ConduitAPIMethod {
final public function getApplication() {
return PhabricatorApplication::getByClass(
'PhabricatorApplicationDiffusion');
}
}

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_diffusion_createcomment_Method final class DiffusionCreateCommentConduitAPIMethod
extends ConduitAPI_diffusion_Method { extends DiffusionConduitAPIMethod {
public function getAPIMethodName() {
return 'diffusion.createcomment';
}
public function getMethodStatus() { public function getMethodStatus() {
return self::METHOD_STATUS_DEPRECATED; return self::METHOD_STATUS_DEPRECATED;

View file

@ -1,10 +1,14 @@
<?php <?php
final class ConduitAPI_diffusion_diffquery_Method final class DiffusionDiffQueryConduitAPIMethod
extends ConduitAPI_diffusion_abstractquery_Method { extends DiffusionQueryConduitAPIMethod {
private $effectiveCommit; private $effectiveCommit;
public function getAPIMethodName() {
return 'diffusion.diffquery';
}
public function getMethodDescription() { public function getMethodDescription() {
return return
'Get diff information from a repository for a specific path at an '. 'Get diff information from a repository for a specific path at an '.

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_diffusion_existsquery_Method final class DiffusionExistsQueryConduitAPIMethod
extends ConduitAPI_diffusion_abstractquery_Method { extends DiffusionQueryConduitAPIMethod {
public function getAPIMethodName() {
return 'diffusion.existsquery';
}
public function getMethodDescription() { public function getMethodDescription() {
return 'Determine if code exists in a version control system.'; return 'Determine if code exists in a version control system.';

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_diffusion_filecontentquery_Method final class DiffusionFileContentQueryConduitAPIMethod
extends ConduitAPI_diffusion_abstractquery_Method { extends DiffusionQueryConduitAPIMethod {
public function getAPIMethodName() {
return 'diffusion.filecontentquery';
}
public function getMethodDescription() { public function getMethodDescription() {
return 'Retrieve file content from a repository.'; return 'Retrieve file content from a repository.';

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_diffusion_findsymbols_Method final class DiffusionFindSymbolsConduitAPIMethod
extends ConduitAPI_diffusion_Method { extends DiffusionConduitAPIMethod {
public function getAPIMethodName() {
return 'diffusion.findsymbols';
}
public function getMethodDescription() { public function getMethodDescription() {
return 'Retrieve Diffusion symbol information.'; return 'Retrieve Diffusion symbol information.';

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_diffusion_getcommits_Method final class DiffusionGetCommitsConduitAPIMethod
extends ConduitAPI_diffusion_Method { extends DiffusionConduitAPIMethod {
public function getAPIMethodName() {
return 'diffusion.getcommits';
}
public function getMethodDescription() { public function getMethodDescription() {
return pht('Retrieve Diffusion commit information.'); return pht('Retrieve Diffusion commit information.');

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_diffusion_getlintmessages_Method final class DiffusionGetLintMessagesConduitAPIMethod
extends ConduitAPI_diffusion_Method { extends DiffusionConduitAPIMethod {
public function getAPIMethodName() {
return 'diffusion.getlintmessages';
}
public function getMethodStatus() { public function getMethodStatus() {
return self::METHOD_STATUS_UNSTABLE; return self::METHOD_STATUS_UNSTABLE;

View file

@ -1,10 +1,14 @@
<?php <?php
final class ConduitAPI_diffusion_getrecentcommitsbypath_Method final class DiffusionGetRecentCommitsByPathConduitAPIMethod
extends ConduitAPI_diffusion_Method { extends DiffusionConduitAPIMethod {
const DEFAULT_LIMIT = 10; const DEFAULT_LIMIT = 10;
public function getAPIMethodName() {
return 'diffusion.getrecentcommitsbypath';
}
public function getMethodDescription() { public function getMethodDescription() {
return 'Get commit identifiers for recent commits affecting a given path.'; return 'Get commit identifiers for recent commits affecting a given path.';
} }

View file

@ -1,10 +1,14 @@
<?php <?php
final class ConduitAPI_diffusion_historyquery_Method final class DiffusionHistoryQueryConduitAPIMethod
extends ConduitAPI_diffusion_abstractquery_Method { extends DiffusionQueryConduitAPIMethod {
private $parents = array(); private $parents = array();
public function getAPIMethodName() {
return 'diffusion.historyquery';
}
public function getMethodDescription() { public function getMethodDescription() {
return 'Returns history information for a repository at a specific '. return 'Returns history information for a repository at a specific '.
'commit and path.'; 'commit and path.';

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_diffusion_lastmodifiedquery_Method final class DiffusionLastModifiedQueryConduitAPIMethod
extends ConduitAPI_diffusion_abstractquery_Method { extends DiffusionQueryConduitAPIMethod {
public function getAPIMethodName() {
return 'diffusion.lastmodifiedquery';
}
public function getMethodDescription() { public function getMethodDescription() {
return pht('Get the commits at which paths were last modified.'); return pht('Get the commits at which paths were last modified.');

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_diffusion_looksoon_Method final class DiffusionLookSoonConduitAPIMethod
extends ConduitAPI_diffusion_Method { extends DiffusionConduitAPIMethod {
public function getAPIMethodName() {
return 'diffusion.looksoon';
}
public function getMethodStatus() { public function getMethodStatus() {
return self::METHOD_STATUS_UNSTABLE; return self::METHOD_STATUS_UNSTABLE;

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_diffusion_mergedcommitsquery_Method final class DiffusionMergedCommitsQueryConduitAPIMethod
extends ConduitAPI_diffusion_abstractquery_Method { extends DiffusionQueryConduitAPIMethod {
public function getAPIMethodName() {
return 'diffusion.mergedcommitsquery';
}
public function getMethodDescription() { public function getMethodDescription() {
return return

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_diffusion_querycommits_Method final class DiffusionQueryCommitsConduitAPIMethod
extends ConduitAPI_diffusion_Method { extends DiffusionConduitAPIMethod {
public function getAPIMethodName() {
return 'diffusion.querycommits';
}
public function getMethodDescription() { public function getMethodDescription() {
return pht('Retrieve information about commits.'); return pht('Retrieve information about commits.');

View file

@ -1,7 +1,7 @@
<?php <?php
abstract class ConduitAPI_diffusion_abstractquery_Method abstract class DiffusionQueryConduitAPIMethod
extends ConduitAPI_diffusion_Method { extends DiffusionConduitAPIMethod {
public function shouldAllowPublic() { public function shouldAllowPublic() {
return true; return true;

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_diffusion_querypaths_Method final class DiffusionQueryPathsConduitAPIMethod
extends ConduitAPI_diffusion_abstractquery_Method { extends DiffusionQueryConduitAPIMethod {
public function getAPIMethodName() {
return 'diffusion.querypaths';
}
public function getMethodDescription() { public function getMethodDescription() {
return pht('Filename search on a repository.'); return pht('Filename search on a repository.');
@ -97,4 +101,5 @@ final class ConduitAPI_diffusion_querypaths_Method
return $results; return $results;
} }
} }

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_diffusion_rawdiffquery_Method final class DiffusionRawDiffQueryConduitAPIMethod
extends ConduitAPI_diffusion_abstractquery_Method { extends DiffusionQueryConduitAPIMethod {
public function getAPIMethodName() {
return 'diffusion.rawdiffquery';
}
public function getMethodDescription() { public function getMethodDescription() {
return return
@ -51,4 +55,5 @@ final class ConduitAPI_diffusion_rawdiffquery_Method
return $raw_query->loadRawDiff(); return $raw_query->loadRawDiff();
} }
} }

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_diffusion_readmequery_Method final class DiffusionReadmeQueryConduitAPIMethod
extends ConduitAPI_diffusion_abstractquery_Method { extends DiffusionQueryConduitAPIMethod {
public function getAPIMethodName() {
return 'diffusion.readmequery';
}
public function getMethodDescription() { public function getMethodDescription() {
return return

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_diffusion_refsquery_Method final class DiffusionRefsQueryConduitAPIMethod
extends ConduitAPI_diffusion_abstractquery_Method { extends DiffusionQueryConduitAPIMethod {
public function getAPIMethodName() {
return 'diffusion.refsquery';
}
public function getMethodDescription() { public function getMethodDescription() {
return return

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_diffusion_resolverefs_Method final class DiffusionResolveRefsConduitAPIMethod
extends ConduitAPI_diffusion_abstractquery_Method { extends DiffusionQueryConduitAPIMethod {
public function getAPIMethodName() {
return 'differential.resolverefsquery';
}
public function getMethodDescription() { public function getMethodDescription() {
return pht('Resolve references into stable, canonical identifiers.'); return pht('Resolve references into stable, canonical identifiers.');

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_diffusion_searchquery_Method final class DiffusionSearchQueryConduitAPIMethod
extends ConduitAPI_diffusion_abstractquery_Method { extends DiffusionQueryConduitAPIMethod {
public function getAPIMethodName() {
return 'differential.searchquery';
}
public function getMethodDescription() { public function getMethodDescription() {
return 'Search (grep) a repository at a specific path and commit.'; return 'Search (grep) a repository at a specific path and commit.';

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_diffusion_tagsquery_Method final class DiffusionTagsQueryConduitAPIMethod
extends ConduitAPI_diffusion_abstractquery_Method { extends DiffusionQueryConduitAPIMethod {
public function getAPIMethodName() {
return 'differential.tagsquery';
}
public function getMethodDescription() { public function getMethodDescription() {
return pht('Retrieve information about tags in a repository.'); return pht('Retrieve information about tags in a repository.');

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_diffusion_updatecoverage_Method final class DiffusionUpdateCoverageConduitAPIMethod
extends ConduitAPI_diffusion_Method { extends DiffusionConduitAPIMethod {
public function getAPIMethodName() {
return 'diffusion.updatecoverage';
}
public function getMethodStatus() { public function getMethodStatus() {
return self::METHOD_STATUS_UNSTABLE; return self::METHOD_STATUS_UNSTABLE;
@ -93,5 +97,4 @@ final class ConduitAPI_diffusion_updatecoverage_Method
$conn->saveTransaction(); $conn->saveTransaction();
} }
} }

View file

@ -1,9 +0,0 @@
<?php
abstract class ConduitAPI_feed_Method extends ConduitAPIMethod {
public function getApplication() {
return PhabricatorApplication::getByClass('PhabricatorFeedApplication');
}
}

View file

@ -0,0 +1,9 @@
<?php
abstract class FeedConduitAPIMethod extends ConduitAPIMethod {
final public function getApplication() {
return PhabricatorApplication::getByClass('PhabricatorApplicationFeed');
}
}

View file

@ -1,6 +1,10 @@
<?php <?php
final class ConduitAPI_feed_publish_Method extends ConduitAPI_feed_Method { final class FeedPublishConduitAPIMethod extends FeedConduitAPIMethod {
public function getAPIMethodName() {
return 'feed.publish';
}
public function getMethodStatus() { public function getMethodStatus() {
return self::METHOD_STATUS_UNSTABLE; return self::METHOD_STATUS_UNSTABLE;

View file

@ -1,6 +1,10 @@
<?php <?php
final class ConduitAPI_feed_query_Method extends ConduitAPI_feed_Method { final class FeedQueryConduitAPIMethod extends FeedConduitAPIMethod {
public function getAPIMethodName() {
return 'feed.query';
}
public function getMethodStatus() { public function getMethodStatus() {
return self::METHOD_STATUS_UNSTABLE; return self::METHOD_STATUS_UNSTABLE;

View file

@ -1,9 +0,0 @@
<?php
abstract class ConduitAPI_file_Method extends ConduitAPIMethod {
public function getApplication() {
return PhabricatorApplication::getByClass('PhabricatorFilesApplication');
}
}

View file

@ -0,0 +1,9 @@
<?php
abstract class FileConduitAPIMethod extends ConduitAPIMethod {
final public function getApplication() {
return PhabricatorApplication::getByClass('PhabricatorApplicationFiles');
}
}

View file

@ -1,6 +1,10 @@
<?php <?php
final class ConduitAPI_file_download_Method extends ConduitAPI_file_Method { final class FileDownloadConduitAPIMethod extends FileConduitAPIMethod {
public function getAPIMethodName() {
return 'file.download';
}
public function getMethodDescription() { public function getMethodDescription() {
return 'Download a file from the server.'; return 'Download a file from the server.';

View file

@ -1,6 +1,10 @@
<?php <?php
final class ConduitAPI_file_info_Method extends ConduitAPI_file_Method { final class FileInfoConduitAPIMethod extends FileConduitAPIMethod {
public function getAPIMethodName() {
return 'file.info';
}
public function getMethodDescription() { public function getMethodDescription() {
return 'Get information about a file.'; return 'Get information about a file.';

View file

@ -1,6 +1,10 @@
<?php <?php
final class ConduitAPI_file_upload_Method extends ConduitAPI_file_Method { final class FileUploadConduitAPIMethod extends FileConduitAPIMethod {
public function getAPIMethodName() {
return 'file.upload';
}
public function getMethodDescription() { public function getMethodDescription() {
return 'Upload a file to the server.'; return 'Upload a file to the server.';

View file

@ -1,6 +1,10 @@
<?php <?php
final class ConduitAPI_file_uploadhash_Method extends ConduitAPI_file_Method { final class FileUploadHashConduitAPIMethod extends FileConduitAPIMethod {
public function getAPIMethodName() {
return 'file.uploadhash';
}
public function getMethodDescription() { public function getMethodDescription() {
return 'Upload a file to the server using content hash.'; return 'Upload a file to the server using content hash.';

View file

@ -1,8 +1,8 @@
<?php <?php
abstract class ConduitAPI_flag_Method extends ConduitAPIMethod { abstract class FlagConduitAPIMethod extends ConduitAPIMethod {
public function getApplication() { final public function getApplication() {
return PhabricatorApplication::getByClass('PhabricatorFlagsApplication'); return PhabricatorApplication::getByClass('PhabricatorFlagsApplication');
} }

View file

@ -1,6 +1,10 @@
<?php <?php
final class ConduitAPI_flag_delete_Method extends ConduitAPI_flag_Method { final class FlagDeleteConduitAPIMethod extends FlagConduitAPIMethod {
public function getAPIMethodName() {
return 'flag.delete';
}
public function getMethodDescription() { public function getMethodDescription() {
return 'Clear a flag.'; return 'Clear a flag.';

View file

@ -1,6 +1,10 @@
<?php <?php
final class ConduitAPI_flag_edit_Method extends ConduitAPI_flag_Method { final class FlagEditConduitAPIMethod extends FlagConduitAPIMethod {
public function getAPIMethodName() {
return 'flag.edit';
}
public function getMethodDescription() { public function getMethodDescription() {
return 'Create or modify a flag.'; return 'Create or modify a flag.';

View file

@ -1,6 +1,10 @@
<?php <?php
final class ConduitAPI_flag_query_Method extends ConduitAPI_flag_Method { final class FlagQueryConduitAPIMethod extends FlagConduitAPIMethod {
public function getAPIMethodName() {
return 'flag.query';
}
public function getMethodDescription() { public function getMethodDescription() {
return 'Query flag markers.'; return 'Query flag markers.';

View file

@ -1,8 +1,8 @@
<?php <?php
abstract class ConduitAPI_harbormaster_Method extends ConduitAPIMethod { abstract class HarbormasterConduitAPIMethod extends ConduitAPIMethod {
public function getApplication() { final public function getApplication() {
return PhabricatorApplication::getByClass( return PhabricatorApplication::getByClass(
'PhabricatorHarbormasterApplication'); 'PhabricatorHarbormasterApplication');
} }

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_harbormaster_querybuildables_Method final class HarbormasterQueryBuildablesConduitAPIMethod
extends ConduitAPI_harbormaster_Method { extends HarbormasterConduitAPIMethod {
public function getAPIMethodName() {
return 'harbormaster.querybuildables';
}
public function getMethodDescription() { public function getMethodDescription() {
return pht('Query Harbormaster buildables.'); return pht('Query Harbormaster buildables.');

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_harbormaster_querybuilds_Method final class HarbormasterQueryBuildsConduitAPIMethod
extends ConduitAPI_harbormaster_Method { extends HarbormasterConduitAPIMethod {
public function getAPIMethodName() {
return 'harbormaster.querybuilds';
}
public function getMethodDescription() { public function getMethodDescription() {
return pht('Query Harbormaster builds.'); return pht('Query Harbormaster builds.');

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_harbormaster_sendmessage_Method final class HarbormasterSendMessageConduitAPIMethod
extends ConduitAPI_harbormaster_Method { extends HarbormasterConduitAPIMethod {
public function getAPIMethodName() {
return 'harbormaster.sendmessage';
}
public function getMethodDescription() { public function getMethodDescription() {
return pht( return pht(

View file

@ -1,9 +0,0 @@
<?php
abstract class ConduitAPI_macro_Method extends ConduitAPIMethod {
public function getApplication() {
return PhabricatorApplication::getByClass('PhabricatorMacroApplication');
}
}

View file

@ -0,0 +1,9 @@
<?php
abstract class MacroConduitAPIMethod extends ConduitAPIMethod {
final public function getApplication() {
return PhabricatorApplication::getByClass('PhabricatorApplicationMacro');
}
}

View file

@ -1,6 +1,10 @@
<?php <?php
final class ConduitAPI_macro_creatememe_Method extends ConduitAPI_macro_Method { final class MacroCreateMemeConduitAPIMethod extends MacroConduitAPIMethod {
public function getAPIMethodName() {
return 'macro.creatememe';
}
public function getMethodStatus() { public function getMethodStatus() {
return self::METHOD_STATUS_UNSTABLE; return self::METHOD_STATUS_UNSTABLE;

View file

@ -1,6 +1,10 @@
<?php <?php
final class ConduitAPI_macro_query_Method extends ConduitAPI_macro_Method { final class MacroQueryConduitAPIMethod extends MacroConduitAPIMethod {
public function getAPIMethodName() {
return 'macro.query';
}
public function getMethodDescription() { public function getMethodDescription() {
return 'Retrieve image macro information.'; return 'Retrieve image macro information.';

View file

@ -1,8 +1,8 @@
<?php <?php
abstract class ConduitAPI_maniphest_Method extends ConduitAPIMethod { abstract class ManiphestConduitAPIMethod extends ConduitAPIMethod {
public function getApplication() { final public function getApplication() {
return PhabricatorApplication::getByClass( return PhabricatorApplication::getByClass(
'PhabricatorManiphestApplication'); 'PhabricatorManiphestApplication');
} }

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_maniphest_createtask_Method final class ManiphestCreateTaskConduitAPIMethod
extends ConduitAPI_maniphest_Method { extends ManiphestConduitAPIMethod {
public function getAPIMethodName() {
return 'maniphest.createtask';
}
public function getMethodDescription() { public function getMethodDescription() {
return 'Create a new Maniphest task.'; return 'Create a new Maniphest task.';
@ -17,7 +21,7 @@ final class ConduitAPI_maniphest_createtask_Method
public function defineErrorTypes() { public function defineErrorTypes() {
return array( return array(
'ERR-INVALID-PARAMETER' => 'Missing or malformed parameter.' 'ERR-INVALID-PARAMETER' => 'Missing or malformed parameter.',
); );
} }

View file

@ -3,8 +3,12 @@
/** /**
* @concrete-extensible * @concrete-extensible
*/ */
final class ConduitAPI_maniphest_find_Method final class ManiphestFindConduitAPIMethod
extends ConduitAPI_maniphest_query_Method { extends ManiphestQueryConduitAPIMethod {
public function getAPIMethodName() {
return 'maniphest.find';
}
public function getMethodStatus() { public function getMethodStatus() {
return self::METHOD_STATUS_DEPRECATED; return self::METHOD_STATUS_DEPRECATED;

View file

@ -1,7 +1,11 @@
<?php <?php
final class ConduitAPI_maniphest_gettasktransactions_Method final class ManiphestGetTaskTransactionsConduitAPIMethod
extends ConduitAPI_maniphest_Method { extends ManiphestConduitAPIMethod {
public function getAPIMethodName() {
return 'maniphest.gettasktransactions';
}
public function getMethodDescription() { public function getMethodDescription() {
return 'Retrieve Maniphest Task Transactions.'; return 'Retrieve Maniphest Task Transactions.';

View file

@ -1,7 +1,10 @@
<?php <?php
final class ConduitAPI_maniphest_info_Method final class ManiphestInfoConduitAPIMethod extends ManiphestConduitAPIMethod {
extends ConduitAPI_maniphest_Method {
public function getAPIMethodName() {
return 'maniphest.info';
}
public function getMethodDescription() { public function getMethodDescription() {
return 'Retrieve information about a Maniphest task, given its id.'; return 'Retrieve information about a Maniphest task, given its id.';

View file

@ -5,7 +5,11 @@
* *
* @concrete-extensible * @concrete-extensible
*/ */
class ConduitAPI_maniphest_query_Method extends ConduitAPI_maniphest_Method { class ManiphestQueryConduitAPIMethod extends ManiphestConduitAPIMethod {
public function getAPIMethodName() {
return 'maniphest.query';
}
public function getMethodDescription() { public function getMethodDescription() {
return 'Execute complex searches for Maniphest tasks.'; return 'Execute complex searches for Maniphest tasks.';

Some files were not shown because too many files have changed in this diff Show more