$style->
comment('Setting visibility to private in private bucket.'
);
$this->
setVisibility($this->filesystemPrivate,
$style, 'private'
);
$style->
comment('Setting visibility to public in public bucket.'
);
$this->
setVisibility($this->filesystemPublic,
$style, 'public'
);
$style->
comment('Setting visibility to public in theme bucket.'
);
$this->
setVisibility($this->filesystemTheme,
$style, 'public'
);
$style->
comment('Setting visibility to public in sitemap bucket.'
);
$this->
setVisibility($this->filesystemSitemap,
$style, 'public'
);
$style->
comment('Setting visibility to public in asset bucket.'
);
$this->
setVisibility($this->filesystemAsset,
$style, 'public'
);
$style->
info('Finished setting visibility of objects in all pre-defined buckets.'
);
return Command::SUCCESS;
} private function setVisibility(FilesystemOperator
$filesystem, ShopwareStyle
$style, string
$visibility): void
{ $files =
array_filter($filesystem->
listContents('/', true
)->
toArray(),
fn (StorageAttributes
$object): bool =>
$object->
type() === 'file'
);
ProgressBar::
setFormatDefinition('custom', '[%bar%] %current%/%max% -- %message%'
);
$progressBar =
new ProgressBar($style, \
count((array) $files));
$progressBar->
setFormat('custom'
);
$progressBar->
setMessage(''
);