mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-02-04 13:06:53 +00:00
Make instance_restore_attempt an attribute
Signed-off-by: Pablo Zmdl <pablo@nextcloud.com>
This commit is contained in:
parent
33fb191dfc
commit
e4fe52f694
3 changed files with 11 additions and 17 deletions
|
|
@ -48,6 +48,11 @@ class ConfigurationManager
|
|||
set { $this->set('backup-mode', $value); }
|
||||
}
|
||||
|
||||
public bool $instance_restore_attempt {
|
||||
get => $this->get('instance_restore_attempt', false);
|
||||
set { $this->set('instance_restore_attempt', $value); }
|
||||
}
|
||||
|
||||
public string $AIO_URL {
|
||||
get => $this->get('AIO_URL', '');
|
||||
set { $this->set('AIO_URL', $value); }
|
||||
|
|
@ -529,8 +534,11 @@ class ConfigurationManager
|
|||
$config['borg_backup_host_location'] = $location;
|
||||
$config['borg_remote_repo'] = $repo;
|
||||
$config['borg_restore_password'] = $password;
|
||||
$config['instance_restore_attempt'] = 1;
|
||||
$this->WriteConfig($config);
|
||||
|
||||
$this->setMultiple(function ($confManager) {
|
||||
$confManager->instance_restore_attempt = true;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -663,18 +671,6 @@ class ConfigurationManager
|
|||
return $config['borg_restore_password'];
|
||||
}
|
||||
|
||||
public function isInstanceRestoreAttempt() : bool {
|
||||
$config = $this->GetConfig();
|
||||
if(!isset($config['instance_restore_attempt'])) {
|
||||
$config['instance_restore_attempt'] = '';
|
||||
}
|
||||
|
||||
if ($config['instance_restore_attempt'] === 1) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function GetNextcloudMount() : string {
|
||||
$envVariableName = 'NEXTCLOUD_MOUNT';
|
||||
$configName = 'nextcloud_mount';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue