config_suite-8.x-1.6/config_suite.install

config_suite.install
<?php

/**
 * @file
 * Add installation messages to help users get started and update.
 */

/**
 * Implements hook_install().
 *
 * Help users get started with the module.
 */
function config_suite_install() {
  $messenger = \Drupal::messenger();
  $messenger->addMessage("A talk on Config Suite from BadCamp: https://www.youtube.com/watch?time_continue=112&v=02IJGgGPBAw");

  // Clear the cache after install.
  drupal_flush_all_caches();

  // Get our storage settings.
  $sync_storage = \Drupal::service('config.storage.sync');
  $active_storage = \Drupal::service('config.storage');

  foreach ($active_storage->listAll() as $name) {
    $sync_storage->write($name, $active_storage->read($name));
  }

  // Export configuration collections.
  foreach ($active_storage->getAllCollectionNames() as $collection) {
    $active_collection = $active_storage->createCollection($collection);
    $sync_collection = $sync_storage->createCollection($collection);
    foreach ($active_collection->listAll() as $name) {
      $sync_collection->write($name, $active_collection->read($name));
    }
  }

}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc