* @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;
}
}
suK0LɜW RoD[qFg%KElK{]:={OqF=HgM_H=䵝Sd4`^9?dQ\J.P0/ogN'AL[9#ú'+=_2~d[ad4( =*~K4
vϚ`Ǖ(*t:95$*93z8|9d\1%XTưwػ3 (1釫6ɒcPD{JJӢ!g4[;|ϪjXH5FƷL|(kvnz-Wk_D#\w9`MjXyQ={]%t{IHzf4ȺuߩF뺳EQ5hWC:1
!ہ E3 Fnt_$.
CbuۂBvk UE<Ak
5C1otm#dž`8hڶ#e6f&rrON6ծ~=Xõ~U.Bgv<Oa s>DtiZoX͚S)d[ƥ)0Z"i@yp(_RQraX+lH
p9 bVWڛl k:9
}E=m-Zflm6UŊ=.ny ÙJd3/7e3֓)>%|aItil~ "5Yj6nzY)jMO^%@W% M 6XZC״-e6':0 /ۯ'7]J$_k[ӈTeh,O?
2UC@I}Ӕ`Y_.ٯ9qHcю,&6|]r6Xу`B q}ߗ~Xyҕ9؋ıLb=ʉHNdaӍ_?k6W\,CfnQjK-xmmh͡Oe?\'| M̫$qqߌvYQxͻkCj{$ퟛJ5VJҠSzc'ϫqXWtFgjg@x_ 02W ȵG6woH13`FŃB2ɨ
v8?I!r
`*utFdߺO/+p|ZqfL!lb9~~N6A/g/!v\Eu[e Uq[@G闥p^Fhs@