mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-09-28 09:34:52 +08:00
rework getbackupvolumes and getallbackupvolumes to be a bit more easy to read and understand
Signed-off-by: Simon L <szaimen@e.mail.de>
This commit is contained in:
parent
a32b5c1bcf
commit
e2dd2f8fcf
1 changed files with 8 additions and 13 deletions
|
@ -510,29 +510,24 @@ class DockerActionManager
|
|||
}
|
||||
}
|
||||
|
||||
private function getBackupVolumes(string $id) : array
|
||||
private function getBackupVolumes(string $id) : string
|
||||
{
|
||||
$container = $this->containerDefinitionFetcher->GetContainerById($id);
|
||||
|
||||
$backupVolumes = $container->GetBackupVolumes();
|
||||
|
||||
$backupVolumes = '';
|
||||
foreach ($container->GetBackupVolumes() as $backupVolume) {
|
||||
$backupVolumes .= $backupVolume . ' ';
|
||||
}
|
||||
foreach ($container->GetDependsOn() as $dependency) {
|
||||
$backupVolumes[] = $this->getBackupVolumes($dependency);
|
||||
$backupVolumes .= $this->getBackupVolumes($dependency);
|
||||
}
|
||||
return $backupVolumes;
|
||||
}
|
||||
|
||||
private function getAllBackupVolumes() : array {
|
||||
$id = 'nextcloud-aio-apache';
|
||||
$backupVolumesArray = $this->getBackupVolumes($id);
|
||||
// Flatten array
|
||||
$backupVolumesArrayFlat = iterator_to_array(
|
||||
new \RecursiveIteratorIterator(
|
||||
new \RecursiveArrayIterator($backupVolumesArray)
|
||||
),
|
||||
$use_keys = false
|
||||
);
|
||||
return array_unique($backupVolumesArrayFlat);
|
||||
$backupVolumesArray = explode(' ', $this->getBackupVolumes($id));
|
||||
return array_unique($backupVolumesArray);
|
||||
}
|
||||
|
||||
private function GetRepoDigestsOfContainer(string $containerName) : ?array {
|
||||
|
|
Loading…
Add table
Reference in a new issue