Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F106814192
FileQueryChunksConduitAPIMethod.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
Tue, Apr 1, 01:09
Size
1019 B
Mime Type
text/x-php
Expires
Thu, Apr 3, 01:09 (2 d)
Engine
blob
Format
Raw Data
Handle
25280944
Attached To
rPH Phabricator
FileQueryChunksConduitAPIMethod.php
View Options
<?php
final
class
FileQueryChunksConduitAPIMethod
extends
FileConduitAPIMethod
{
public
function
getAPIMethodName
()
{
return
'file.querychunks'
;
}
public
function
getMethodDescription
()
{
return
pht
(
'Get information about file chunks.'
);
}
public
function
defineParamTypes
()
{
return
array
(
'filePHID'
=>
'phid'
,
);
}
public
function
defineReturnType
()
{
return
'list<wild>'
;
}
public
function
defineErrorTypes
()
{
return
array
();
}
protected
function
execute
(
ConduitAPIRequest
$request
)
{
$viewer
=
$request
->
getUser
();
$file_phid
=
$request
->
getValue
(
'filePHID'
);
$file
=
$this
->
loadFileByPHID
(
$viewer
,
$file_phid
);
$chunks
=
$this
->
loadFileChunks
(
$viewer
,
$file
);
$results
=
array
();
foreach
(
$chunks
as
$chunk
)
{
$results
[]
=
array
(
'byteStart'
=>
$chunk
->
getByteStart
(),
'byteEnd'
=>
$chunk
->
getByteEnd
(),
'complete'
=>
(
bool
)
$chunk
->
getDataFilePHID
(),
);
}
return
$results
;
}
}
Event Timeline
Log In to Comment