Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. RecipeCommand.php

function 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
Executes the current command.

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();
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal