You are here

public function PurgerCommands::purgerMoveUp in Purge 8.3

Move the given purger UP in the execution order.

@usage drush p:purger-mv-down ID Move this purger up.

@command p:purger-mvu @aliases ppmvu,p-purger-mvu

Parameters

string $id: The instance ID of the purger to move up.

array $options: Associative array of options whose values come from Drush.

File

modules/purge_drush/src/Commands/PurgerCommands.php, line 223

Class

PurgerCommands
Configure Purge Purgers from the command line.

Namespace

Drupal\purge_drush\Commands

Code

public function purgerMoveUp($id, array $options = [
  'format' => 'string',
]) {
  $enabled = $this->purgePurgers
    ->getPluginsEnabled();

  // Verify that the purger instance exists.
  if (!isset($enabled[$id])) {
    throw new \Exception(dt('The given instance ID is not valid!'));
  }

  // Move the purger up and finish command execution.
  $this->purgePurgers
    ->movePurgerUp($id);
  if ($options['format'] == 'string') {
    $this
      ->io()
      ->success(dt('The purger moved one place up!'));
  }
}