disable_messages.install in Disable Messages 8
Same filename and directory in other branches
Filter Messages Module install file.
File
disable_messages.installView source
<?php
/**
* @file
* Filter Messages Module install file.
*/
/**
* Implements hook_install().
*/
function disable_messages_install() {
$config = \Drupal::service('config.factory')
->getEditable('disable_messages.settings');
$config
->set('disable_messages_enable', '1');
$config
->set('disable_messages_ignore_patterns', '');
$config
->set('disable_messages_ignore_regex', []);
$config
->set('disable_messages_ignore_case', '1');
$config
->set('disable_messages_filter_by_page', '0');
$config
->set('disable_messages_page_filter_paths', '');
$config
->set('disable_messages_exclude_users', '');
$config
->set('disable_messages_enable_debug', '0');
$config
->set('disable_messages_debug_visible_div', '0');
$config
->save();
}
/**
* Implements hook_uninstall().
*/
function disable_messages_uninstall() {
$config = \Drupal::service('config.factory')
->getEditable('disable_messages.settings');
$config
->clear('disable_messages_enable');
$config
->clear('disable_messages_ignore_patterns');
$config
->clear('disable_messages_ignore_regex');
$config
->clear('disable_messages_ignore_case');
$config
->clear('disable_messages_filter_by_page');
$config
->clear('disable_messages_page_filter_paths');
$config
->clear('disable_messages_exclude_users');
$config
->clear('disable_messages_enable_debug');
$config
->clear('disable_messages_debug_visible_div');
$config
->save();
// Permission deletions are handled by core.
}
Functions
Name | Description |
---|---|
disable_messages_install | Implements hook_install(). |
disable_messages_uninstall | Implements hook_uninstall(). |