site_install.inc

  1. 8.0.x commands/core/drupal/site_install.inc
  2. 6.x commands/core/drupal/site_install.inc
  3. 7.x commands/core/drupal/site_install.inc
  4. 4.x commands/core/drupal/site_install.inc
  5. 5.x commands/core/drupal/site_install.inc
  6. master commands/core/drupal/site_install.inc

Functions

Namesort descending Description
drush_core_site_install_version Install Drupal 7+

File

commands/core/drupal/site_install.inc
View source
  1. <?php
  2. /**
  3. * Install Drupal 7+
  4. */
  5. function drush_core_site_install_version($profile, array $additional_form_options = array()) {
  6. if (!isset($profile)) {
  7. $profile = 'standard';
  8. }
  9. require_once DRUSH_DRUPAL_CORE . '/includes/install.core.inc';
  10. $db_spec = _drush_sql_get_db_spec();
  11. $account_pass = drush_get_option('account-pass', drush_generate_password());
  12. $account_name = drush_get_option('account-name', 'admin');
  13. $settings = array(
  14. 'parameters' => array(
  15. 'profile' => $profile,
  16. 'locale' => drush_get_option('locale', 'en'),
  17. ),
  18. 'forms' => array(
  19. 'install_settings_form' => array(
  20. 'driver' => $db_spec['driver'],
  21. $db_spec['driver'] => $db_spec,
  22. 'op' => dt('Save and continue'),
  23. ),
  24. 'install_configure_form' => array(
  25. 'site_name' => drush_get_option('site-name', 'Site-Install'),
  26. 'site_mail' => drush_get_option('site-mail', 'admin@example.com'),
  27. 'account' => array(
  28. 'name' => $account_name,
  29. 'mail' => drush_get_option('account-mail', 'admin@example.com'),
  30. 'pass' => array(
  31. 'pass1' => $account_pass,
  32. 'pass2' => $account_pass,
  33. ),
  34. ),
  35. 'update_status_module' => array(
  36. 1 => TRUE,
  37. 2 => TRUE,
  38. ),
  39. 'clean_url' => drush_get_option('clean-url', TRUE),
  40. 'op' => dt('Save and continue'),
  41. ),
  42. ),
  43. );
  44. // Merge in the additional options.
  45. foreach ($additional_form_options as $key => $value) {
  46. $current = &$settings['forms'];
  47. foreach (explode('.', $key) as $param) {
  48. $current = &$current[$param];
  49. }
  50. $current = $value;
  51. }
  52. drush_log(dt('Starting Drupal installation. This takes a few seconds ...'), 'ok');
  53. drush_op('install_drupal', $settings);
  54. drush_log(dt('Installation complete. User name: @name User password: @pass', array('@name' => $account_name, '@pass' => $account_pass)), 'ok');
  55. }