当前位置: 首页>>代码示例>>PHP>>正文


PHP ProgressBar::setProgressCharacter方法代码示例

本文整理汇总了PHP中Symfony\Component\Console\Helper\ProgressBar::setProgressCharacter方法的典型用法代码示例。如果您正苦于以下问题:PHP ProgressBar::setProgressCharacter方法的具体用法?PHP ProgressBar::setProgressCharacter怎么用?PHP ProgressBar::setProgressCharacter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Symfony\Component\Console\Helper\ProgressBar的用法示例。


在下文中一共展示了ProgressBar::setProgressCharacter方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: progressBarInit

 private function progressBarInit($count)
 {
     if ($this->progressBar === null) {
         return;
     }
     $this->progressBar->start($count);
     $this->progressBar->setBarCharacter(Constants::CHARACTER_PROGRESS_BAR);
     $this->progressBar->setProgressCharacter(Constants::CHARACTER_BEER);
 }
开发者ID:bitban,项目名称:php-code-quality-tools,代码行数:9,代码来源:HookManager.php

示例2: execute

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     /** @var ImportAddressService $importAddressService */
     $importAddressService = $this->getHelper('container')->getByType('StreetApi\\Services\\ImportAddressService');
     $cityId = $input->getArgument('cityId');
     $xmlFile = simplexml_load_file($importAddressService->getRootDir() . '/../adresy.xml');
     if (!$xmlFile) {
         $output->writeln(PHP_EOL . '<error>Missing source file!</error>');
         return 1;
     }
     try {
         $output->writeLn('<info>Start importing addresses</info>');
         $totalCount = $xmlFile->count();
         $output->writeln(PHP_EOL . PHP_EOL . PHP_EOL . PHP_EOL);
         $progressBar = new ProgressBar($output, $totalCount);
         $progressBar->setFormat('%message%' . PHP_EOL . '%bar% %percent:3s% %' . PHP_EOL . 'count: %current%/%max%' . PHP_EOL . 'time:  %elapsed:6s%/%estimated:-6s%' . PHP_EOL);
         $progressBar->setBarCharacter('<info>■</info>');
         $progressBar->setEmptyBarCharacter(' ');
         $progressBar->setProgressCharacter('');
         $progressBar->setRedrawFrequency(ceil($totalCount / 100));
         $progressBar->start();
         $importAddressService->import($xmlFile, $progressBar, $cityId);
         $output->writeLn(PHP_EOL . '<info>Importing addresses finished</info>');
         return 0;
     } catch (\Exception $e) {
         $output->writeLn('<error>' . $e->getMessage() . '</error>');
         return 1;
     }
 }
开发者ID:neogenia,项目名称:mvcr-street-api,代码行数:29,代码来源:ImportAddressCommand.php

示例3: createProgressBar

 /**
  * @param OutputInterface $output
  * @return ProgressBar
  */
 protected function createProgressBar(OutputInterface $output)
 {
     $progress = new ProgressBar($output);
     $progress->setBarCharacter('<comment>=</comment>');
     $progress->setProgressCharacter('|');
     $progress->setFormat(self::PROGRESS_BAR_MESSAGE_FORMAT);
     return $progress;
 }
开发者ID:seregazhuk,项目名称:leanpub-console-command,代码行数:12,代码来源:OutputSubscriber.php

示例4: getProgress

 /**
  * Progress bar define
  *
  * @param \Symfony\Component\Console\Output\OutputInterface $output
  * @param int                                               $finish
  * @param string                                            $format
  * @return \Symfony\Component\Console\Helper\ProgressBar
  */
 public function getProgress(OutputInterface $output, $finish = 100, $format = 'normal')
 {
     $progress = new ProgressBar($output, $finish);
     $progress->setProgressCharacter('ϟ');
     $progress->setFormat($format);
     $progress->setBarCharacter('<comment>=</comment>');
     return $progress;
 }
开发者ID:stanislav-web,项目名称:express-mailer,代码行数:16,代码来源:ProgressTrait.php

示例5: createProgressBar

 /**
  * @param OutputInterface $output
  * @param int $length
  *
  * @return ProgressBar
  */
 protected function createProgressBar(OutputInterface $output, $length = 10)
 {
     $progress = new ProgressBar($output);
     $progress->setBarCharacter('<info>|</info>');
     $progress->setEmptyBarCharacter(' ');
     $progress->setProgressCharacter('|');
     $progress->start($length);
     return $progress;
 }
开发者ID:sylius,项目名称:sylius,代码行数:15,代码来源:AbstractInstallCommand.php

示例6: setupProgressBar

 /**
  * Setup the progress bar.
  *
  * @param \Symfony\Component\Console\Output\OutputInterface $output
  */
 protected function setupProgressBar(OutputInterface $output)
 {
     $this->progress = new ProgressBar($output, count($this->themes) * count($this->patterns));
     $this->progress->setFormat("<info>%message%</info>\n<fg=red>[</>%bar%<fg=red>]</> <fg=yellow>(%current%/%max%) (%elapsed%)</>");
     $this->progress->setBarCharacter('<fg=blue>#</>');
     $this->progress->setProgressCharacter("<fg=magenta>#</>");
     $this->progress->setMessage('Test');
     $this->progress->start();
 }
开发者ID:daylerees,项目名称:rainbow,代码行数:14,代码来源:GenerateCommand.php

示例7: create

 public static function create(OutputInterface $output)
 {
     $bar = new ProgressBar($output);
     $bar->setBarCharacter('<fg=green>=</>');
     $bar->setEmptyBarCharacter('<fg=red>=</>');
     $bar->setProgressCharacter('>');
     $bar->setBarWidth(40);
     $bar->setFormat("%message%\n [%bar%] %percent:3s%%\n%elapsed:6s%/%estimated:-6s% %memory:6s%\n");
     return $bar;
 }
开发者ID:skymeyer,项目名称:sugardev,代码行数:10,代码来源:ProgressBarFactory.php

示例8: getProgressBar

 /**
  * @param OutputInterface $output
  *
  * @return \Symfony\Component\Console\Helper\ProgressBar
  */
 private function getProgressBar(OutputInterface $output)
 {
     $bar = new ProgressBar($output);
     $bar->setFormat(' %current%/%max% [%bar%] %percent:3s%% %memory:6s%');
     $bar->setBarCharacter('<comment>=</comment>');
     $bar->setEmptyBarCharacter(' ');
     $bar->setProgressCharacter('|');
     $bar->setBarWidth(50);
     return $bar;
 }
开发者ID:lexcast,项目名称:fminor-core,代码行数:15,代码来源:BuildCommand.php

示例9: barSetup

 /**
  * Setting custom formatting for the progress bar
  * @param  object $bar Symfony ProgressBar instance
  * @return object $bar Symfony ProgressBar instance
  */
 public function barSetup(ProgressBar $bar)
 {
     // the finished part of the bar
     $bar->setBarCharacter('<comment>=</comment>');
     // the unfinished part of the bar
     $bar->setEmptyBarCharacter('-');
     // the progress character
     $bar->setProgressCharacter('>');
     // the 'layout' of the bar
     $bar->setFormat(' %current%/%max% [%bar%] %percent:3s%% ');
     return $bar;
 }
开发者ID:laravolt,项目名称:packer,代码行数:17,代码来源:PackerHelper.php

示例10: build

 /**
  * @return \Symfony\Component\Console\Helper\ProgressBar
  */
 public function build()
 {
     $this->setupFormat();
     $progressBar = new ProgressBar($this->output, $this->count);
     $progressBar->setMessage($this->barTitle, 'barTitle');
     $progressBar->setBarWidth(20);
     if ($this->output->getVerbosity() > OutputInterface::VERBOSITY_VERBOSE) {
         $progressBar->setBarCharacter("[32m◼[0m");
         $progressBar->setEmptyBarCharacter("[31m◼[0m");
         $progressBar->setProgressCharacter("[32m▶[0m");
         $progressBar->setBarWidth(50);
     }
     return $progressBar;
 }
开发者ID:spryker,项目名称:Gui,代码行数:17,代码来源:ProgressBarBuilder.php

示例11: execute

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $rows = 100;
     $progressBar = new ProgressBar($output, $rows);
     $progressBar->setBarCharacter('<comment>=</comment>');
     $progressBar->setProgressCharacter('>');
     $progressBar->setBarWidth(77);
     $table = new Table($output);
     for ($i = 0; $i < $rows; $i++) {
         $table->addRow([sprintf('Row <info># %s</info>', $i), rand(0, 1000)]);
         usleep(50000);
         $progressBar->advance();
     }
     $progressBar->finish();
     $output->writeln('');
     $table->render();
 }
开发者ID:SymfonyId,项目名称:PlaySymfony,代码行数:17,代码来源:TableCommand.php

示例12: set_task_count

 /**
  * {@inheritdoc}
  */
 public function set_task_count($task_count, $restart = false)
 {
     parent::set_task_count($task_count, $restart);
     if ($this->output->getVerbosity() === OutputInterface::VERBOSITY_NORMAL) {
         $this->progress_bar = $this->io->createProgressBar($task_count);
         $this->progress_bar->setFormat("    %current:3s%/%max:-3s% %bar%  %percent:3s%%\n" . "             %message%\n");
         $this->progress_bar->setBarWidth(60);
         if (!defined('PHP_WINDOWS_VERSION_BUILD')) {
             $this->progress_bar->setEmptyBarCharacter('░');
             // light shade character \u2591
             $this->progress_bar->setProgressCharacter('');
             $this->progress_bar->setBarCharacter('▓');
             // dark shade character \u2593
         }
         $this->progress_bar->setMessage('');
         $this->io->newLine(2);
         $this->progress_bar->start();
     }
 }
开发者ID:MrAdder,项目名称:phpbb,代码行数:22,代码来源:cli_iohandler.php

示例13: onStart

 /**
  * @param array $data
  */
 protected function onStart(array $data)
 {
     $format = isset($this->options['format']) ? $this->options['format'] : 'normal';
     if (isset($data['total']) && $data['total'] > 0) {
         $maxSteps = (int) $data['total'];
         unset($data['total']);
     } else {
         $maxSteps = 1;
     }
     $progress = new ProgressBar($this->output, $maxSteps);
     $progress->setFormat($format);
     $progress->setEmptyBarCharacter(' ');
     $progress->setProgressCharacter(':');
     foreach ($data as $key => $value) {
         $progress->setMessage($value, $key);
     }
     $progress->start();
     $this->progress = $progress;
 }
开发者ID:flamecore,项目名称:seabreeze,代码行数:22,代码来源:ConsoleProgressResponder.php

示例14: execute

 /**
  * @param InputInterface $input
  * @param OutputInterface $output
  * @return void
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     try {
         $verbosityLevelMap = array(LogLevel::NOTICE => OutputInterface::VERBOSITY_NORMAL, LogLevel::INFO => OutputInterface::VERBOSITY_NORMAL);
         $logger = new ConsoleLogger($output, $verbosityLevelMap);
         $progressBar = new ProgressBar($output);
         $progressBar->setFormat("<info>[info] %message% : %current%/%max% [</info>%bar%<info>] %percent:3s%% %elapsed:6s%/%estimated:-6s%</info>");
         $progressBar->setEmptyBarCharacter('<fg=red>-</>');
         $progressBar->setBarCharacter('<info>=</info>');
         $progressBar->setProgressCharacter('<info>></info>');
         $output->writeln("\n\r<question>Execution de la passerelle JLP-IMMO</question>");
         // Appel du service correpondant au CRON
         $services = $this->getContainer()->get('jlp_core.passerelle');
         $responseServices = $services->execute($logger, $progressBar);
         $output->writeln("<info>Passerelle resultat : " . print_r($responseServices, true) . "</info>");
         $output->writeln("\n\r");
     } catch (\Exception $e) {
         $output->writeln("\t<error>Passerelle Exception : " . $e . '</error>');
     }
 }
开发者ID:jbcfrance,项目名称:jlp-immo,代码行数:25,代码来源:PasserelleExecuteCommand.php

示例15: createProgressBar

 private function createProgressBar($max = 100)
 {
     $bar = new ProgressBar($this->output, $max);
     $bar->setBarCharacter('<info>#</info>');
     $bar->setProgressCharacter('<info>#</info>');
     $bar->setFormat("%message%\n" . '%percent:3s%% [%bar%] %elapsed:6s%/%estimated:-6s%   ');
     return $bar;
 }
开发者ID:martinsik,项目名称:php-doc-parser,代码行数:8,代码来源:RunCommand.php


注:本文中的Symfony\Component\Console\Helper\ProgressBar::setProgressCharacter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。