Skip to content

Instantly share code, notes, and snippets.

@yusufhm
Created February 14, 2017 04:12
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save yusufhm/875338b94baa2f81c05bde034c49abb3 to your computer and use it in GitHub Desktop.
drupal 8 import config programmatically
<?php
// The following snippet updates the filter format configuration.
$config_path = drupal_get_path('module', 'my_custom_module') . '/config/install'; // or any path containing config files theoretically.
$source = new FileStorage($config_path);
$config_storage = \Drupal::service('config.storage');
$config_storage->write('filter.format.basic_html', $source->read('filter.format.basic_html'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment