You are here

protected function ImportCommand::checkImportingState in Tome 8

Checks the importing state and prompts the user if applicable.

Parameters

array $options: An array of command line options.

Return value

bool Whether or not the process should continue.

2 calls to ImportCommand::checkImportingState()
ImportCommand::execute in modules/tome_sync/src/Commands/ImportCommand.php
ImportPartialCommand::execute in modules/tome_sync/src/Commands/ImportPartialCommand.php

File

modules/tome_sync/src/Commands/ImportCommand.php, line 220

Class

ImportCommand
Contains the tome:import command.

Namespace

Drupal\tome_sync\Commands

Code

protected function checkImportingState(array $options) {
  if ($this->state
    ->get(ImporterInterface::STATE_KEY_IMPORTING, FALSE)) {
    if (!$options['yes'] && !$this
      ->io()
      ->confirm('Another user may be running an import, proceed only if the last import failed unexpectedly. Ignore and continue import?', FALSE)) {
      return FALSE;
    }
  }
  return TRUE;
}