pino-8.x-1.2-no-core/pino.install
pino.install
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | <?php /** * @file * Install, update and uninstall functions for the pino installation profile. */ use Drupal\user\Entity\User; /** * Implements hook_install(). * * Perform actions to set up the site for this profile. * * @see system_install() */ function pino_install() { // Set front page to newest members. \Drupal::configFactory()->getEditable( 'system.site' )->set( 'page.front' , '/latest' )->save(TRUE); // Allow only administrators to create accounts. $user_settings = \Drupal::configFactory()->getEditable( 'user.settings' ); $user_settings ->set( 'register' , USER_REGISTER_ADMINISTRATORS_ONLY)->save(TRUE); // Assign user 1 the "administrator" role. $user = User::load(1); $user ->roles[] = 'administrator' ; $user ->save(); // Clear all caches. drupal_flush_all_caches(); } |