Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93020547
DiffusionRawDiffQueryConduitAPIMethod.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Nov 25, 15:11
Size
1 KB
Mime Type
text/x-php
Expires
Wed, Nov 27, 15:11 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22559601
Attached To
rPH Phabricator
DiffusionRawDiffQueryConduitAPIMethod.php
View Options
<?php
final
class
DiffusionRawDiffQueryConduitAPIMethod
extends
DiffusionQueryConduitAPIMethod
{
public
function
getAPIMethodName
()
{
return
'diffusion.rawdiffquery'
;
}
public
function
getMethodDescription
()
{
return
pht
(
'Get raw diff information from a repository for a specific commit at an '
.
'(optional) path.'
);
}
protected
function
defineReturnType
()
{
return
'string'
;
}
protected
function
defineCustomParamTypes
()
{
return
array
(
'commit'
=>
'required string'
,
'path'
=>
'optional string'
,
'timeout'
=>
'optional int'
,
'byteLimit'
=>
'optional int'
,
'linesOfContext'
=>
'optional int'
,
'againstCommit'
=>
'optional string'
,
);
}
protected
function
getResult
(
ConduitAPIRequest
$request
)
{
$drequest
=
$this
->
getDiffusionRequest
();
$raw_query
=
DiffusionRawDiffQuery
::
newFromDiffusionRequest
(
$drequest
);
$timeout
=
$request
->
getValue
(
'timeout'
);
if
(
$timeout
!==
null
)
{
$raw_query
->
setTimeout
(
$timeout
);
}
$lines_of_context
=
$request
->
getValue
(
'linesOfContext'
);
if
(
$lines_of_context
!==
null
)
{
$raw_query
->
setLinesOfContext
(
$lines_of_context
);
}
$against_commit
=
$request
->
getValue
(
'againstCommit'
);
if
(
$against_commit
!==
null
)
{
$raw_query
->
setAgainstCommit
(
$against_commit
);
}
$byte_limit
=
$request
->
getValue
(
'byteLimit'
);
if
(
$byte_limit
!==
null
)
{
$raw_query
->
setByteLimit
(
$byte_limit
);
}
return
$raw_query
->
loadRawDiff
();
}
}
Event Timeline
Log In to Comment