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
|
* direction: string - up | down
|
||||||
* expectedsize: int - file size in bytes
|
* expectedsize: int - file size in bytes
|
||||||
* realsize: int - currently transported bytes
|
* realsize: int - currently transported bytes
|
||||||
* expectedchsum: string - orginal file checksum
|
* expectedsum: string - orginal file checksum
|
||||||
* realchsum: string - transported file checksum
|
* realsum: string - transported file checksum
|
||||||
* title: string - dc:title or filename etc.
|
* title: string - dc:title or filename etc.
|
||||||
* errmsg: string - error message for failed transports
|
* errmsg: string - error message for failed transports
|
||||||
* ... ?
|
* ... ?
|
||||||
|
@ -187,10 +187,14 @@ class Transport
|
||||||
$res = array();
|
$res = array();
|
||||||
foreach (array(
|
foreach (array(
|
||||||
'trtype', 'state', 'direction', 'expectedsize', 'realsize',
|
'trtype', 'state', 'direction', 'expectedsize', 'realsize',
|
||||||
'expectedchsum', 'realchsum', 'title', 'errmsg'
|
'expectedsum', 'realsum', 'title', 'errmsg'
|
||||||
) as $k) {
|
) as $k) {
|
||||||
$res[$k] = ( isset($trec->row[$k]) ? $trec->row[$k] : NULL );
|
$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
|
// do not return finished on finished search job upload
|
||||||
// - whole search is NOT finished
|
// - whole search is NOT finished
|
||||||
if ($res['trtype'] == "searchjob" && $res['direction'] == "up" && $res['state'] == "finished") {
|
if ($res['trtype'] == "searchjob" && $res['direction'] == "up" && $res['state'] == "finished") {
|
||||||
|
|
|
@ -159,7 +159,7 @@ $infos = array(
|
||||||
|
|
||||||
"getTransportInfo" => array('m'=>"locstor.getTransportInfo",
|
"getTransportInfo" => array('m'=>"locstor.getTransportInfo",
|
||||||
'p'=>array('trtok'),
|
'p'=>array('trtok'),
|
||||||
'r'=>array('state', 'realsize', 'expectedsize', 'realchsum', 'expectedchsum')),
|
'r'=>array('state', 'realsize', 'expectedsize', 'realsum', 'expectedsum')),
|
||||||
"turnOnOffTransports" => array('m'=>"locstor.turnOnOffTransports",
|
"turnOnOffTransports" => array('m'=>"locstor.turnOnOffTransports",
|
||||||
'p'=>array('sessid', 'onOff'), 'r'=>array('state')),
|
'p'=>array('sessid', 'onOff'), 'r'=>array('state')),
|
||||||
"doTransportAction" => array('m'=>"locstor.doTransportAction",
|
"doTransportAction" => array('m'=>"locstor.doTransportAction",
|
||||||
|
@ -187,7 +187,7 @@ $infos = array(
|
||||||
"createBackupClose" => array('m'=>"locstor.createBackupClose",
|
"createBackupClose" => array('m'=>"locstor.createBackupClose",
|
||||||
'p'=>array('token'), 'r'=>array('status')),
|
'p'=>array('token'), 'r'=>array('status')),
|
||||||
"restoreBackupOpen" => array('m'=>"locstor.restoreBackupOpen",
|
"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",
|
"restoreBackupClosePut" => array('m'=>"locstor.restoreBackupClosePut",
|
||||||
'p'=>array('sessid', 'token'), 'r'=>array('token')),
|
'p'=>array('sessid', 'token'), 'r'=>array('token')),
|
||||||
"restoreBackupCheck" => array('m'=>"locstor.restoreBackupCheck",
|
"restoreBackupCheck" => array('m'=>"locstor.restoreBackupCheck",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue