function SandboxManagerBase::storeDestroyInfo

Stores information about the stage when it is destroyed.

Parameters

bool $force: Whether the stage was force destroyed.

\Drupal\Core\StringTranslation\TranslatableMarkup|null $message: A message about why the stage was destroyed or null.

Throws

\Drupal\Core\TempStore\TempStoreException

1 call to SandboxManagerBase::storeDestroyInfo()
SandboxManagerBase::destroy in core/modules/package_manager/src/SandboxManagerBase.php
Deletes the stage directory.

File

core/modules/package_manager/src/SandboxManagerBase.php, line 873

Class

SandboxManagerBase
Creates and manages a stage directory in which to install or update code.

Namespace

Drupal\package_manager

Code

protected function storeDestroyInfo(bool $force, ?TranslatableMarkup $message) : void {
  if (!$message) {
    if ($this->tempStore
      ->get(self::TEMPSTORE_CHANGES_APPLIED) === TRUE) {
      $message = $this->t('This operation has already been applied.');
    }
    else {
      if ($force) {
        $message = $this->t('This operation was canceled by another user.');
      }
      else {
        $message = $this->t('This operation was already canceled.');
      }
    }
  }
  [$id] = $this->tempStore
    ->get(static::TEMPSTORE_LOCK_KEY);
  $this->tempStore
    ->set(self::TEMPSTORE_DESTROYED_STAGES_INFO_PREFIX . $id, $message);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.