PHP code example of makinacorpus / drush-progressbar

1. Go to this page and download the library: Download makinacorpus/drush-progressbar library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

makinacorpus / drush-progressbar example snippets



$total = some_count();

$bar = \DrushProgressBar::create();
$bar->start();

$done = 0;
foreach ($items as $item) {
  process_item($item);

  // Note that here, you could also change the total (yes you can).
  $bar->setProgress($total, ++$done);
}

$bar->end();

$total
$done