function RecipeCommand::rollBackToCheckpoint

Same name in other branches
  1. 11.x core/lib/Drupal/Core/Recipe/RecipeCommand.php \Drupal\Core\Recipe\RecipeCommand::rollBackToCheckpoint()

Rolls config back to a particular checkpoint.

Parameters

\Drupal\Core\Config\Checkpoint\Checkpoint $checkpoint: The checkpoint to roll back to.

1 call to RecipeCommand::rollBackToCheckpoint()
RecipeCommand::execute in core/lib/Drupal/Core/Recipe/RecipeCommand.php

File

core/lib/Drupal/Core/Recipe/RecipeCommand.php, line 159

Class

RecipeCommand
Applies recipe.

Namespace

Drupal\Core\Recipe

Code

private function rollBackToCheckpoint(Checkpoint $checkpoint) : void {
    $container = \Drupal::getContainer();
    
    /** @var \Drupal\Core\Config\Checkpoint\CheckpointStorageInterface $checkpoint_storage */
    $checkpoint_storage = $container->get('config.storage.checkpoint');
    $checkpoint_storage->setCheckpointToReadFrom($checkpoint);
    $storage_comparer = new StorageComparer($checkpoint_storage, $container->get('config.storage'));
    $storage_comparer->reset();
    $config_importer = new ConfigImporter($storage_comparer, $container->get('event_dispatcher'), $container->get('config.manager'), $container->get('lock'), $container->get('config.typed'), $container->get('module_handler'), $container->get('module_installer'), $container->get('theme_handler'), $container->get('string_translation'), $container->get('extension.list.module'), $container->get('extension.list.theme'));
    $config_importer->import();
}

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