configManager = $config_manager; $this->sourceStorage = $source_storage; $this->snapshotStorage = $snapshot_storage; } /** * Creates a config snapshot. * * @param \Drupal\Core\Config\ConfigImporterEvent $event * The Event to process. */ public function onConfigImporterImport(ConfigImporterEvent $event) { $this->configManager->createSnapshot($this->sourceStorage, $this->snapshotStorage); } /** * Registers the methods in this class that should be listeners. * * @return array * An array of event listener definitions. */ public static function getSubscribedEvents() { $events[ConfigEvents::IMPORT][] = ['onConfigImporterImport', 40]; return $events; } }