Mercurial > hg > isophonics-drupal-site
annotate core/modules/syslog/syslog.install @ 19:fa3358dc1485 tip
Add ndrum files
author | Chris Cannam |
---|---|
date | Wed, 28 Aug 2019 13:14:47 +0100 |
parents | 4c8ae668cc8c |
children |
rev | line source |
---|---|
Chris@0 | 1 <?php |
Chris@0 | 2 |
Chris@0 | 3 /** |
Chris@0 | 4 * @file |
Chris@0 | 5 * Install, update and uninstall functions for the syslog module. |
Chris@0 | 6 */ |
Chris@0 | 7 |
Chris@0 | 8 /** |
Chris@0 | 9 * Implements hook_install(). |
Chris@0 | 10 */ |
Chris@0 | 11 function syslog_install() { |
Chris@0 | 12 // The default facility setting depends on the operating system, so it needs |
Chris@0 | 13 // to be set dynamically during installation. |
Chris@0 | 14 \Drupal::configFactory()->getEditable('syslog.settings')->set('facility', defined('LOG_LOCAL0') ? LOG_LOCAL0 : LOG_USER)->save(); |
Chris@0 | 15 } |
Chris@0 | 16 |
Chris@0 | 17 /** |
Chris@0 | 18 * Convert syslog.settings.facility to an integer. |
Chris@0 | 19 */ |
Chris@0 | 20 function syslog_update_8400() { |
Chris@0 | 21 $config = \Drupal::configFactory()->getEditable('syslog.settings'); |
Chris@0 | 22 $facility = (int) $config->get('facility'); |
Chris@0 | 23 $config->set('facility', $facility)->save(TRUE); |
Chris@0 | 24 } |