syslog.install 679 B

123456789101112131415161718192021222324
  1. <?php
  2. /**
  3. * @file
  4. * Install, update and uninstall functions for the syslog module.
  5. */
  6. /**
  7. * Implements hook_install().
  8. */
  9. function syslog_install() {
  10. // The default facility setting depends on the operating system, so it needs
  11. // to be set dynamically during installation.
  12. \Drupal::configFactory()->getEditable('syslog.settings')->set('facility', defined('LOG_LOCAL0') ? LOG_LOCAL0 : LOG_USER)->save();
  13. }
  14. /**
  15. * Convert syslog.settings.facility to an integer.
  16. */
  17. function syslog_update_8400() {
  18. $config = \Drupal::configFactory()->getEditable('syslog.settings');
  19. $facility = (int) $config->get('facility');
  20. $config->set('facility', $facility)->save(TRUE);
  21. }