You are here

public function Updater::hasActiveUpdate in Automatic Updates 8.2

Determines if there is an active update in progress.

Return value

bool TRUE if there is active update, otherwise FALSE.

File

src/Updater.php, line 120

Class

Updater
Defines a service to perform updates.

Namespace

Drupal\automatic_updates

Code

public function hasActiveUpdate() : bool {
  $staged_dir = $this->pathLocator
    ->getStageDirectory();
  if (is_dir($staged_dir) || $this->state
    ->get(static::STATE_KEY)) {
    return TRUE;
  }
  return FALSE;
}