function drush_core_site_install_version

8.0.x site_install_7.inc drush_core_site_install_version($profile, array $additional_form_options = array())
8.0.x site_install_6.inc drush_core_site_install_version($profile, array $additional_form_options = array())
8.0.x site_install.inc drush_core_site_install_version($profile, array $additional_form_options = array())
6.x site_install_6.inc drush_core_site_install_version($profile, array $additional_form_options = array())
6.x site_install.inc drush_core_site_install_version($profile, array $additional_form_options = array())
7.x site_install_7.inc drush_core_site_install_version($profile, array $additional_form_options = array())
7.x site_install_6.inc drush_core_site_install_version($profile, array $additional_form_options = array())
7.x site_install.inc drush_core_site_install_version($profile, array $additional_form_options = array())
4.x site_install_6.inc drush_core_site_install_version($profile)
4.x site_install.inc drush_core_site_install_version($profile, array $additional_form_options = array())
5.x site_install_6.inc drush_core_site_install_version($profile, array $additional_form_options = array())
5.x site_install.inc drush_core_site_install_version($profile, array $additional_form_options = array())
master site_install.inc drush_core_site_install_version($profile, array $additional_form_options = array())
master site_install_7.inc drush_core_site_install_version($profile, array $additional_form_options = array())

Install Drupal 6.x

1 call to drush_core_site_install_version()
drush_core_site_install in commands/core/site_install.drush.inc
Command callback.

File

commands/core/drupal/site_install_6.inc, line 6

Code

function drush_core_site_install_version($profile) {
  if (is_null($profile)) {
    $profile = 'default';
  }
  $drupal_root = drush_get_context('DRUSH_DRUPAL_ROOT');

  // We need to disable reporting of E_NOTICE if we want to read the command's output
  // on Windows, because of how Windows is handling output order when using 2>&1
  // redirect added to the command in drush_shell_exec(). We will actually take out
  // all but fatal errors.  See http://drupal.org/node/985716 for more information.
  $phpcode = 'error_reporting(E_ERROR);' . _drush_site_install6_cookies($profile) . ' include("' . $drupal_root . '/install.php");';
  drush_shell_exec('php -r %s', $phpcode);
  $cli_output = drush_shell_exec_output();
  $cli_cookie = end($cli_output);

  // We need to bootstrap the database to be able to check the progress of the 
  // install batch process since we're not duplicating the install process using
  // drush_batch functions, but calling the process directly.
  drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_DATABASE);

  $status = _drush_site_install6_stage($profile, $cli_cookie, "start");
  if ($status === FALSE) {
    return FALSE;
  }

  $status = _drush_site_install6_stage($profile, $cli_cookie, "do_nojs");
  if ($status === FALSE) {
    return FALSE;
  }

  $status = _drush_site_install6_stage($profile, $cli_cookie, "finished");
  if ($status === FALSE) {
    return FALSE;
  }

  $account_pass = drush_get_option('account-pass', 'admin');
  $phpcode = _drush_site_install6_cookies($profile, $cli_cookie);
  $phpcode .= '
  $_POST = array (
    "site_name" => "' . drush_get_option('site-name', 'Site-Install') . '", 
    "site_mail" => "' . drush_get_option('site-mail', 'admin@example.com') . '", 
    "account" => array (
      "name" => "' . drush_get_option('account-name', 'admin') . '",
      "mail" => "' . drush_get_option('account-mail', 'admin@example.com') . '",
      "pass" => array (
        "pass1" => "' . $account_pass . '",
        "pass2" => "' . $account_pass . '"
      )
    ),
    "date_default_timezone"=>"0", 
    "clean_url"=>' . drush_get_option('clean-url', TRUE) . ',
    "form_id"=>"install_configure_form", 
    "update_status_module" => array("1"=>"1")
  );
  include("' . $drupal_root . '/install.php");';
  drush_shell_exec('php -r %s', $phpcode);
}