You are here

public function LinkCheckerCommands::check in Link checker 8

Check link status.

@command linkchecker:check

@aliases lcch

File

src/Commands/LinkCheckerCommands.php, line 123

Class

LinkCheckerCommands
Drush 9 commands for Linkchecker module.

Namespace

Drupal\linkchecker\Commands

Code

public function check() {
  $this
    ->logger()
    ->info('Starting link checking...');

  // Always rebuild queue on Drush command run to check all links.
  if (empty($this->checkerBatch
    ->getTotalLinksToProcess())) {
    $this->logger
      ->notice($this
      ->t('There are no links to check.'));
    return;
  }
  $this->checkerBatch
    ->batch();
  drush_backend_batch_process();
}