config_packager-8.x-1.x-dev/config_packager.install

config_packager.install
<?php

/**
 * @file
 * Install, update and uninstall functions for the config_packager module.
 */

/**
 * Implements hook_install().
 *
 * Populates the profile config_packaging settings based on site name and
 * slogan.
 */
function config_packager_install() {
  $site_config = \Drupal::config('system.site');
  $site_name = $site_config->get('name');
  \Drupal::configFactory()->getEditable('config_packager.settings')
    ->set('profile.machine_name', preg_replace('@[^a-z0-9_]+@', '_', strtolower($site_name)))
    ->set('profile.name', $site_name)
    ->set('profile.description', $site_config->get('slogan'))
    ->save();
}

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

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