Fixed return structure of getTransportInfo.
This commit is contained in:
parent
d2e9df0d15
commit
fa0f1ffbff
2 changed files with 9 additions and 5 deletions
|
@ -172,8 +172,8 @@ class Transport
|
|||
* direction: string - up | down
|
||||
* expectedsize: int - file size in bytes
|
||||
* realsize: int - currently transported bytes
|
||||
* expectedchsum: string - orginal file checksum
|
||||
* realchsum: string - transported file checksum
|
||||
* expectedsum: string - orginal file checksum
|
||||
* realsum: string - transported file checksum
|
||||
* title: string - dc:title or filename etc.
|
||||
* errmsg: string - error message for failed transports
|
||||
* ... ?
|
||||
|
@ -187,10 +187,14 @@ class Transport
|
|||
$res = array();
|
||||
foreach (array(
|
||||
'trtype', 'state', 'direction', 'expectedsize', 'realsize',
|
||||
'expectedchsum', 'realchsum', 'title', 'errmsg'
|
||||
'expectedsum', 'realsum', 'title', 'errmsg'
|
||||
) as $k) {
|
||||
$res[$k] = ( isset($trec->row[$k]) ? $trec->row[$k] : NULL );
|
||||
}
|
||||
if ( file_exists($trec->row['localfile']) ){
|
||||
$res['realsize'] = filesize($trec->row['localfile']);
|
||||
$res['realsum'] = $this->_chsum($trec->row['localfile']);
|
||||
}
|
||||
// do not return finished on finished search job upload
|
||||
// - whole search is NOT finished
|
||||
if ($res['trtype'] == "searchjob" && $res['direction'] == "up" && $res['state'] == "finished") {
|
||||
|
|
|
@ -159,7 +159,7 @@ $infos = array(
|
|||
|
||||
"getTransportInfo" => array('m'=>"locstor.getTransportInfo",
|
||||
'p'=>array('trtok'),
|
||||
'r'=>array('state', 'realsize', 'expectedsize', 'realchsum', 'expectedchsum')),
|
||||
'r'=>array('state', 'realsize', 'expectedsize', 'realsum', 'expectedsum')),
|
||||
"turnOnOffTransports" => array('m'=>"locstor.turnOnOffTransports",
|
||||
'p'=>array('sessid', 'onOff'), 'r'=>array('state')),
|
||||
"doTransportAction" => array('m'=>"locstor.doTransportAction",
|
||||
|
@ -187,7 +187,7 @@ $infos = array(
|
|||
"createBackupClose" => array('m'=>"locstor.createBackupClose",
|
||||
'p'=>array('token'), 'r'=>array('status')),
|
||||
"restoreBackupOpen" => array('m'=>"locstor.restoreBackupOpen",
|
||||
'p'=>array('sessid', 'filename'), 'r'=>array('url', 'token')),
|
||||
'p'=>array('sessid', 'chsum'), 'r'=>array('url', 'token')),
|
||||
"restoreBackupClosePut" => array('m'=>"locstor.restoreBackupClosePut",
|
||||
'p'=>array('sessid', 'token'), 'r'=>array('token')),
|
||||
"restoreBackupCheck" => array('m'=>"locstor.restoreBackupCheck",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue