mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-02-16 02:30:17 +00:00
Merge pull request #2621 from nextcloud/enh/noid/rework-getbackupvolumes
rework getbackupvolumes and getallbackupvolumes to be a bit more easy…
This commit is contained in:
commit
28b1e249a8
1 changed files with 8 additions and 13 deletions
|
|
@ -514,29 +514,24 @@ class DockerActionManager
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getBackupVolumes(string $id) : array
|
private function getBackupVolumes(string $id) : string
|
||||||
{
|
{
|
||||||
$container = $this->containerDefinitionFetcher->GetContainerById($id);
|
$container = $this->containerDefinitionFetcher->GetContainerById($id);
|
||||||
|
|
||||||
$backupVolumes = $container->GetBackupVolumes();
|
$backupVolumes = '';
|
||||||
|
foreach ($container->GetBackupVolumes() as $backupVolume) {
|
||||||
|
$backupVolumes .= $backupVolume . ' ';
|
||||||
|
}
|
||||||
foreach ($container->GetDependsOn() as $dependency) {
|
foreach ($container->GetDependsOn() as $dependency) {
|
||||||
$backupVolumes[] = $this->getBackupVolumes($dependency);
|
$backupVolumes .= $this->getBackupVolumes($dependency);
|
||||||
}
|
}
|
||||||
return $backupVolumes;
|
return $backupVolumes;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getAllBackupVolumes() : array {
|
private function getAllBackupVolumes() : array {
|
||||||
$id = 'nextcloud-aio-apache';
|
$id = 'nextcloud-aio-apache';
|
||||||
$backupVolumesArray = $this->getBackupVolumes($id);
|
$backupVolumesArray = explode(' ', $this->getBackupVolumes($id));
|
||||||
// Flatten array
|
return array_unique($backupVolumesArray);
|
||||||
$backupVolumesArrayFlat = iterator_to_array(
|
|
||||||
new \RecursiveIteratorIterator(
|
|
||||||
new \RecursiveArrayIterator($backupVolumesArray)
|
|
||||||
),
|
|
||||||
$use_keys = false
|
|
||||||
);
|
|
||||||
return array_unique($backupVolumesArrayFlat);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function GetNextcloudExecCommands(string $id) : string
|
private function GetNextcloudExecCommands(string $id) : string
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue