figli_starter_kit.install 564 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. /**
  3. * @file
  4. * Install, update and uninstall hooks for the figli starter kit install profile.
  5. */
  6. use Drupal\user\Entity\User;
  7. /**
  8. * Implements hook_install().
  9. *
  10. * Perform actions to set up the site for this profile.
  11. *
  12. * @see system_install()
  13. */
  14. function figli_starter_kit_install() {
  15. // Add code here to make nodes, terms, etc.
  16. // Assign user 1 the "administrator" role.
  17. $user = User::load(1);
  18. $user->roles[] = 'root';
  19. $user->save();
  20. // Don't do anything else during config sync.
  21. if (\Drupal::isConfigSyncing()) {
  22. return;
  23. }
  24. }