domain_alias.install 828 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /**
  3. * @file
  4. * Install, update and uninstall functions for the Domain Alias module.
  5. */
  6. /**
  7. * Sets the default set of environments.
  8. */
  9. function domain_alias_set_environments() {
  10. $config = \Drupal::service('config.factory')->getEditable('domain_alias.settings');
  11. // Set and save new message value.
  12. $config->set('environments', ['default', 'local', 'development', 'staging', 'testing'])->save();
  13. }
  14. /**
  15. * Updates domain_alias schema.
  16. */
  17. function domain_alias_update_8001() {
  18. $manager = \Drupal::entityDefinitionUpdateManager();
  19. // Regenerate entity type indexes.
  20. $manager->updateEntityType($manager->getEntityType('domain_alias'));
  21. }
  22. /**
  23. * Adds domain_alias environment settings.
  24. */
  25. function domain_alias_update_8002() {
  26. // Set the default environments variable.
  27. domain_alias_set_environments();
  28. }