Split progressbar output into two windows.
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@ -9,6 +9,7 @@ use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Output\ConsoleOutputInterface;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
use App\Template\Twig;
|
||||
use App\Notification\Notification;
|
||||
@ -45,6 +46,13 @@ class CommandBackup extends Command
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
$sio = new SymfonyStyle($input, $output);
|
||||
$sioProgressbar = &$sio;
|
||||
|
||||
if ($output instanceof ConsoleOutputInterface) {
|
||||
$sio = new SymfonyStyle($input, $output->section());
|
||||
$sioProgressbar = new SymfonyStyle($input, $output->section());
|
||||
}
|
||||
|
||||
$sio->title('Start backup process');
|
||||
|
||||
try {
|
||||
@ -68,7 +76,7 @@ class CommandBackup extends Command
|
||||
/** @var array{title: string, source: string, destination: string}[] */
|
||||
$backupElements = $app->getConfig('backup');
|
||||
/** @var array{title: string, source: string, destination: string} $conf */
|
||||
foreach ($sio->progressIterate($backupElements) as $conf) {
|
||||
foreach ($sioProgressbar->progressIterate($backupElements) as $conf) {
|
||||
$title = $conf['title'];
|
||||
$template = array();
|
||||
$template['config'] = $conf;
|
||||
|
Reference in New Issue
Block a user