2013-05-14 22:53:32 +02:00
|
|
|
<?php
|
|
|
|
|
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
2014-07-25 02:54:15 +02:00
|
|
|
final class DiffusionRawDiffQueryConduitAPIMethod
|
|
|
|
extends DiffusionQueryConduitAPIMethod {
|
|
|
|
|
|
|
|
public function getAPIMethodName() {
|
|
|
|
return 'diffusion.rawdiffquery';
|
|
|
|
}
|
2013-05-14 22:53:32 +02:00
|
|
|
|
|
|
|
public function getMethodDescription() {
|
|
|
|
return
|
|
|
|
'Get raw diff information from a repository for a specific commit at an '.
|
|
|
|
'(optional) path.';
|
|
|
|
}
|
|
|
|
|
2015-04-13 00:59:07 +02:00
|
|
|
protected function defineReturnType() {
|
2013-05-14 22:53:32 +02:00
|
|
|
return 'string';
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function defineCustomParamTypes() {
|
|
|
|
return array(
|
|
|
|
'commit' => 'required string',
|
|
|
|
'path' => 'optional string',
|
|
|
|
'timeout' => 'optional int',
|
2014-01-03 21:27:19 +01:00
|
|
|
'byteLimit' => 'optional int',
|
2013-05-14 22:53:32 +02:00
|
|
|
'linesOfContext' => 'optional int',
|
|
|
|
'againstCommit' => 'optional string',
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function getResult(ConduitAPIRequest $request) {
|
|
|
|
$drequest = $this->getDiffusionRequest();
|
|
|
|
|
|
|
|
$raw_query = DiffusionRawDiffQuery::newFromDiffusionRequest($drequest);
|
2014-01-03 21:27:19 +01:00
|
|
|
|
|
|
|
$timeout = $request->getValue('timeout');
|
2013-05-14 22:53:32 +02:00
|
|
|
if ($timeout !== null) {
|
|
|
|
$raw_query->setTimeout($timeout);
|
|
|
|
}
|
2014-01-03 21:27:19 +01:00
|
|
|
|
|
|
|
$lines_of_context = $request->getValue('linesOfContext');
|
2013-05-14 22:53:32 +02:00
|
|
|
if ($lines_of_context !== null) {
|
|
|
|
$raw_query->setLinesOfContext($lines_of_context);
|
|
|
|
}
|
2014-01-03 21:27:19 +01:00
|
|
|
|
|
|
|
$against_commit = $request->getValue('againstCommit');
|
2013-05-14 22:53:32 +02:00
|
|
|
if ($against_commit !== null) {
|
|
|
|
$raw_query->setAgainstCommit($against_commit);
|
|
|
|
}
|
2014-01-03 21:27:19 +01:00
|
|
|
|
|
|
|
$byte_limit = $request->getValue('byteLimit');
|
|
|
|
if ($byte_limit !== null) {
|
|
|
|
$raw_query->setByteLimit($byte_limit);
|
|
|
|
}
|
|
|
|
|
2013-05-14 22:53:32 +02:00
|
|
|
return $raw_query->loadRawDiff();
|
|
|
|
}
|
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
2014-07-25 02:54:15 +02:00
|
|
|
|
2013-05-14 22:53:32 +02:00
|
|
|
}
|