From eb0b26c367ab1f282a0909da8df799338874149b Mon Sep 17 00:00:00 2001 From: dingguodong Date: Fri, 7 Jun 2024 16:43:54 +0800 Subject: [PATCH] + [task#116512] Backup the system before the upgrade. --- module/system/control.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/module/system/control.php b/module/system/control.php index bbf4d6be25..dc1fb12900 100644 --- a/module/system/control.php +++ b/module/system/control.php @@ -320,6 +320,21 @@ class system extends control $this->loadModel('action')->create('system', 0, 'upgradeSystem'); + if($backup == 'yes') + { + $instance = $this->config->instance->zentaopaas; + $backupResult = $this->cne->backup($instance, 'SYSTEM', 'upgrade'); + if($backupResult->code != 200) $this->sendError($backupResult->message); + + while(true) + { + $backupStatus = $this->cne->getBackupStatus($instance, $backupResult->data->name); + if($backupStatus->code != 200) $this->sendError($backupStatus->message); + if(strtolower($backupStatus->data->status) == 'completed') break; + sleep(1); + } + } + $rawResult = $this->cne->upgrade($edition); if($rawResult) {