* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
namespace phpbb\console\command;
use Symfony\Component\Console\Helper\ProgressBar;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
abstract class command extends \Symfony\Component\Console\Command\Command
{
/** @var \phpbb\user */
protected $user;
/**
* Constructor
*
* @param \phpbb\user $user User instance (mostly for translation)
*/
public function __construct(\phpbb\user $user)
{
$this->user = $user;
parent::__construct();
}
/**
* Create a styled progress bar
*
* @param int $max Max value for the progress bar
* @param SymfonyStyle $io Symfony style output decorator
* @param OutputInterface $output The output stream, used to print messages
* @param bool $message Should we display message output under the progress bar?
* @return ProgressBar
*/
public function create_progress_bar($max, SymfonyStyle $io, OutputInterface $output, $message = false)
{
$progress = $io->createProgressBar($max);
if ($output->getVerbosity() === OutputInterface::VERBOSITY_VERBOSE)
{
$progress->setFormat('[%percent:3s%%] %message%');
$progress->setOverwrite(false);
}
else if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERY_VERBOSE)
{
$progress->setFormat('[%current:s%/%max:s%][%elapsed%/%estimated%][%memory%] %message%');
$progress->setOverwrite(false);
}
else
{
$io->newLine(2);
$progress->setFormat(
" %current:s%/%max:s% %bar% %percent:3s%%\n" .
" " . ($message ? '%message%' : ' ') . " %elapsed:6s%/%estimated:-6s% %memory:6s%\n");
$progress->setBarWidth(60);
}
if (!defined('PHP_WINDOWS_VERSION_BUILD'))
{
$progress->setEmptyBarCharacter('░'); // light shade character \u2591
$progress->setProgressCharacter('');
$progress->setBarCharacter('▓'); // dark shade character \u2593
}
return $progress;
}
}
e;#5Dm<;)deO
f?*r4^NG0]-~ox'7EJֆy@gQWTNik@+)_:b&̒fjuietKUJӜ4SdKhw}2 8x0W-RJB@EhEHM#%k=xΕw`hJCoKHfݻ@.;?CgQ{RXtDxJVѰ5'!?CU,l/iJS`E=%9w6?+p- mH|0%j{;!`ؕM?yQ<#V뾂ǛO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