You are here

public function RunUpdatesCommand::update_runner in Scheduled Updates 8

Check all or named types for scheduled updates.

@command sup:run_updates @aliases sup-run, sup:run

@usage drush sup:run Run updates.

@option types Set to comma-separated list of machine name(s) of the types to update, otherwise all types.

Parameters

array $options: (optional) The options.

Return value

string OK message.

File

src/Commands/RunUpdatesCommand.php, line 61

Class

RunUpdatesCommand
Class RunUpdatesCommand.

Namespace

Drupal\scheduled_updates\Commands

Code

public function update_runner($options = [
  'types' => NULL,
]) {
  if ($this->scheduledUpdatesRunner) {
    if ($options['types']) {
      $update_types = explode(',', $options['types']);
    }
    else {
      $update_types = [];
    }
    $this->scheduledUpdatesRunner
      ->runAllUpdates($update_types, TRUE);
    $this
      ->output()
      ->writeln(dt('Updates run.'));
    return;
  }
  $message = dt('Could not get Global Runner service. No updates run.');
  $this
    ->output()
    ->writeln($message);
}