From fc866bbfb788109426dd52f01d70495e19bf1812 Mon Sep 17 00:00:00 2001 From: tomash Date: Thu, 9 Nov 2006 01:38:04 +0000 Subject: [PATCH] #1708 fixed return struct of the restoreBackupCheck method --- .../src/modules/storageServer/var/Restore.php | 3 ++- .../storageServer/var/xmlrpc/XR_LocStor.php | 20 +++++++++--------- .../storageServer/var/xmlrpc/xr_cli_test.php | 21 ++++++++++++------- 3 files changed, 26 insertions(+), 18 deletions(-) diff --git a/campcaster/src/modules/storageServer/var/Restore.php b/campcaster/src/modules/storageServer/var/Restore.php index c109000a5..8ada5f8be 100644 --- a/campcaster/src/modules/storageServer/var/Restore.php +++ b/campcaster/src/modules/storageServer/var/Restore.php @@ -111,6 +111,7 @@ class Restore { $this->token = $token; $this->setEnviroment(); if (is_file($this->statusFile)) { + $r = array(); $stat = file_get_contents($this->statusFile); if (strpos($stat,'fault|') !== false) { list($stat,$message) = explode('|',$stat); @@ -119,7 +120,7 @@ class Restore { if ($stat=='fault') { $r['faultString'] = $message; } - $r['token'] = $token; + // $r['token'] = $token; return $r; } else { return PEAR::raiseError('Restore::checkRestore: invalid token!'); diff --git a/campcaster/src/modules/storageServer/var/xmlrpc/XR_LocStor.php b/campcaster/src/modules/storageServer/var/xmlrpc/XR_LocStor.php index 5bd666aa4..df01a5ed9 100644 --- a/campcaster/src/modules/storageServer/var/xmlrpc/XR_LocStor.php +++ b/campcaster/src/modules/storageServer/var/xmlrpc/XR_LocStor.php @@ -1986,10 +1986,8 @@ class XR_LocStor extends LocStor{ * * On success, returns a XML-RPC struct with following fields: * * * On errors, returns an XML-RPC error response. @@ -2017,9 +2015,10 @@ class XR_LocStor extends LocStor{ " ".$res->getUserInfo() ); } - return new XML_RPC_Response(XML_RPC_encode(array( - 'status'=>$res, - ))); +# return new XML_RPC_Response(XML_RPC_encode(array( +# 'status'=>$res, +# ))); + return new XML_RPC_Response(XML_RPC_encode($res)); } /** @@ -2063,9 +2062,10 @@ class XR_LocStor extends LocStor{ " ".$res->getUserInfo() ); } - return new XML_RPC_Response(XML_RPC_encode(array( - 'gunid'=>$res, - ))); +# return new XML_RPC_Response(XML_RPC_encode(array( +# 'gunid'=>$res, +# ))); + return new XML_RPC_Response(XML_RPC_encode($res)); } /*========================================================== info methods */ diff --git a/campcaster/src/modules/storageServer/var/xmlrpc/xr_cli_test.php b/campcaster/src/modules/storageServer/var/xmlrpc/xr_cli_test.php index 6549af91b..f6aa48fca 100644 --- a/campcaster/src/modules/storageServer/var/xmlrpc/xr_cli_test.php +++ b/campcaster/src/modules/storageServer/var/xmlrpc/xr_cli_test.php @@ -146,13 +146,6 @@ $infos = array( "renderPlaylistToRSSClose" => array('m'=>"locstor.renderPlaylistToRSSClose", 'p'=>array('token'), 'r'=>array('status')), - "createBackupOpen" => array('m'=>"locstor.createBackupOpen", - 'p'=>array('sessid', 'criteria'), 'r'=>array('token')), - "createBackupCheck" => array('m'=>"locstor.createBackupCheck", - 'p'=>array('token'), 'r'=>array('status', 'url', 'metafile')), - "createBackupClose" => array('m'=>"locstor.createBackupClose", - 'p'=>array('token'), 'r'=>array('status')), - "loadPref" => array('m'=>"locstor.loadPref", 'p'=>array('sessid', 'key'), 'r'=>'value'), "savePref" => array('m'=>"locstor.savePref", @@ -186,6 +179,20 @@ $infos = array( "getSearchResults" => array('m'=>"locstor.getSearchResults", 'p'=>array('trtok')), + "createBackupOpen" => array('m'=>"locstor.createBackupOpen", + 'p'=>array('sessid', 'criteria'), 'r'=>array('token')), + "createBackupCheck" => array('m'=>"locstor.createBackupCheck", +# 'p'=>array('token'), 'r'=>array('status', 'url', 'metafile', 'faultString')), + 'p'=>array('token'), 'r'=>array('status', 'url', 'tmpfile')), + "createBackupClose" => array('m'=>"locstor.createBackupClose", + 'p'=>array('token'), 'r'=>array('status')), + "restoreBackupOpen" => array('m'=>"locstor.restoreBackupOpen", + 'p'=>array('sessid', 'filename'), 'r'=>array('token')), + "restoreBackupCheck" => array('m'=>"locstor.restoreBackupCheck", + 'p'=>array('token'), 'r'=>array('status', 'faultString')), + "restoreBackupClose" => array('m'=>"locstor.restoreBackupClose", + 'p'=>array('token'), 'r'=>array('status')), + /* "uploadToArchive" => array('m'=>"locstor.uploadToArchive", 'p'=>array('sessid', 'gunid'), 'r'=>'trtok'),