Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
digitalascetic/batch-util / SimpleProgressBarMonitor.php
Size: Mime:
<?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();
    }
}