Repository URL to install this package:
|
Version:
6.2.0 ▾
|
digitalascetic/batch-util
/
SimpleProgressBarMonitor.php
|
|---|
<?php
/**
* Created by IntelliJ IDEA.
* User: martino
* Date: 20/05/18
* Time: 10:15
*/
namespace DigitalAscetic\BatchUtil;
use Symfony\Component\Console\Helper\ProgressBar;
use Symfony\Component\Console\Output\OutputInterface;
/**
* Class SimpleProgressBarMonitor
* @package DigitalAscetic\BatchUtil
*/
class SimpleProgressBarMonitor extends ProgressBarMonitor
{
/**
* SimpleProgressBarMonitor constructor.
*/
public function __construct(OutputInterface $output, $max = 0)
{
$bar = new ProgressBar($output, $max);
$bar->setOverwrite(true);
$bar->setBarWidth(80);
$bar->setFormat('very_verbose');
$bar->setBarCharacter('=');
$bar->setEmptyBarCharacter(".");
$bar->setProgressCharacter(">");
$bar->setFormat(
"Status: %message%</>\n%current%/%max% [%bar%] %percent:3s%%\n%estimated:-20s% %memory:20s%"
);
$bar->setMessage('');
parent::__construct($bar);
$this->setDefaultRedrawFrequency();
}
}