diff --git a/livesupport/src/modules/storageServer/var/Backup.php b/livesupport/src/modules/storageServer/var/Backup.php index 03c430c29..248ca41ca 100755 --- a/livesupport/src/modules/storageServer/var/Backup.php +++ b/livesupport/src/modules/storageServer/var/Backup.php @@ -146,6 +146,7 @@ class Backup * @param token : token * @return hasharray with field: * status : string - susccess | working | fault + * faultString: string - description of fault * token : stirng - backup token * url : string - access url * tmpfile : string - access filename @@ -158,6 +159,9 @@ class Backup $this->token = $token; $this->setEnviroment(); $status = file_get_contents($this->statusFile); + if (strpos($status,'fault')!==false) { + list($status,$faultString) = explode('|',$status); + } switch ($status) { case 'success': $r['url'] = $this->gb->getUrlPart()."access/$token.".BACKUP_EXT; @@ -165,6 +169,7 @@ class Backup case 'working': case 'fault': $r['status'] = $status; + $r['faultString'] = $faultString; $r['token'] = $token; break; } diff --git a/livesupport/src/modules/storageServer/var/GreenBox.php b/livesupport/src/modules/storageServer/var/GreenBox.php index c51f6d6ac..d569bebb4 100644 --- a/livesupport/src/modules/storageServer/var/GreenBox.php +++ b/livesupport/src/modules/storageServer/var/GreenBox.php @@ -1014,6 +1014,7 @@ class GreenBox extends BasicStor{ * @param token : string - backup token * @return hasharray with field: * status : string - susccess | working | fault + * faultString: string - description of fault * token : stirng - backup token * url : string - access url */ @@ -1081,6 +1082,7 @@ class GreenBox extends BasicStor{ * @return status : hasharray - fields: * token: string - restore token * status: string - working | fault | success + * faultString: string - description of fault */ function backupRestoreCheck($token) { diff --git a/livesupport/src/modules/storageServer/var/LocStor.php b/livesupport/src/modules/storageServer/var/LocStor.php index 0ac2563de..598736275 100644 --- a/livesupport/src/modules/storageServer/var/LocStor.php +++ b/livesupport/src/modules/storageServer/var/LocStor.php @@ -950,6 +950,7 @@ class LocStor extends BasicStor{ * @param token : string - backup token * @return hasharray with field: * status : string - susccess | working | fault + * faultString: string - description of fault * token : stirng - backup token * url : string - access url */ @@ -1017,6 +1018,7 @@ class LocStor extends BasicStor{ * @return status : hasharray - fields: * token: string - restore token * status: string - working | fault | success + * faultString: string - description of fault */ function restoreBackupCheck($token) { diff --git a/livesupport/src/modules/storageServer/var/Restore.php b/livesupport/src/modules/storageServer/var/Restore.php index 54ac85833..7e90e7f30 100644 --- a/livesupport/src/modules/storageServer/var/Restore.php +++ b/livesupport/src/modules/storageServer/var/Restore.php @@ -87,6 +87,7 @@ class Restore { * @param token : token * @return hasharray with field: * status : string - susccess | working | fault + * faultString : string - description of fault * token : stirng - backup token * url : string - access url * tmpfile : string - access filename @@ -98,7 +99,12 @@ class Restore { $this->token = $token; $this->setEnviroment(); if (is_file($this->statusFile)) { - $r['status'] = file_get_contents($this->statusFile); + $stat = file_get_contents($this->statusFile); + if (strpos($stat,'fault|')!==false) { + list($stat,$message) = explode('|',$stat); + } + $r['status'] = $stat; + if ($stat=='fault') $r['faultString'] = $message; $r['token'] = $token; return $r; } else { @@ -163,13 +169,13 @@ class Restore { " startRestore - addFileToStorage \n". "(".$put->getMessage()."/".$put->getUserInfo().")\n" ); - file_put_contents($this->statusFile, 'fault'); + file_put_contents($this->statusFile, 'fault|'.$put->getMessage()."/".$put->getUserInfo()); return; } } } else { $this->addLogItem("-E- ".date("Ymd-H:i:s")." startRestore - invalid archive format\n"); - file_put_contents($this->statusFile, 'fault'); + file_put_contents($this->statusFile, 'fault|invalid archive format'); return; } file_put_contents($this->statusFile, 'success'); @@ -241,7 +247,7 @@ class Restore { " addFileToStorage - replaceFile Error ". "(".$replace->getMessage()."/".$replace->getUserInfo().")\n" ); - file_put_contents($this->statusFile, 'fault'); + file_put_contents($this->statusFile, 'fault|'.$replace->getMessage()."/".$replace->getUserInfo()); return $replace; } #$this->addLogItem("replace it \n"); @@ -273,7 +279,7 @@ class Restore { "(".$put->getMessage()."/".$put->getUserInfo().")\n" ."\n---\n".file_get_contents($file)."\n---\n" ); - file_put_contents($this->statusFile, 'fault'); + file_put_contents($this->statusFile, 'fault|'.$put->getMessage()."/".$put->getUserInfo()); //$this->addLogItem("Error Object: ".print_r($put,true)."\n"); return $put; } diff --git a/livesupport/src/modules/storageServer/var/xmlrpc/XR_LocStor.php b/livesupport/src/modules/storageServer/var/xmlrpc/XR_LocStor.php index e541b0344..60b23e610 100644 --- a/livesupport/src/modules/storageServer/var/xmlrpc/XR_LocStor.php +++ b/livesupport/src/modules/storageServer/var/xmlrpc/XR_LocStor.php @@ -2002,7 +2002,8 @@ class XR_LocStor extends LocStor{ * * * On errors, returns an XML-RPC error response.