Skip to content

Instantly share code, notes, and snippets.

@tanmayk
Created January 29, 2019 09:19
Show Gist options
  • Save tanmayk/031f82609eb04f29057b077fefefc18c to your computer and use it in GitHub Desktop.
Save tanmayk/031f82609eb04f29057b077fefefc18c to your computer and use it in GitHub Desktop.
D8 equivalent of features_revert.
<?php
$manager = \Drupal::service('features.manager');
$module = 'MODULE_MACHINE_NAME';
$feature = $manager->loadPackage($module, TRUE);
$config_to_create = [
'CONFIG_NAME_1' => '',
'CONFIG_NAME_2' => '',
];
// Import the configurations.
$config_imported = $manager->createConfiguration($config_to_create);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment