function drush_core_site_install

8.0.x site_install.drush.inc drush_core_site_install($profile = NULL)
6.x site_install.drush.inc drush_core_site_install($profile = NULL)
7.x site_install.drush.inc drush_core_site_install($profile = NULL)
3.x site_install.drush.inc drush_core_site_install($profile = 'standard')
4.x site_install.drush.inc drush_core_site_install($profile = NULL)
5.x site_install.drush.inc drush_core_site_install($profile = NULL)
master site_install.drush.inc drush_core_site_install($profile = NULL)

Command callback.

File

commands/core/site_install.drush.inc, line 195

Code

function drush_core_site_install($profile = NULL) {
  $args = func_get_args();
  $form_options = array();

  if ($args) {
    // The first argument is the profile.
    $profile = array_shift($args);
    // Subsequent arguments are additional form values.
    foreach ($args as $arg) {
      list($key, $value) = explode('=', $arg, 2);

      // Allow for numeric and NULL values to be passed in.
      if (is_numeric($value)) {
        $value = intval($value);
      }
      elseif ($value == 'NULL') {
        $value = NULL;
      }

      $form_options[$key] = $value;
    }
  }

  // --config-dir fails with Standard profile and any other one that carries content entities.
  // Force to minimal install profile.
  if (drush_get_option('config-dir')) {
    drush_log(dt("Using 'minimal' install profile since --config-dir option was provided.", 'ok'));
    $profile = 'minimal';
  }

  drush_include_engine('drupal', 'site_install');
  drush_core_site_install_version($profile, $form_options);

  // Post installation, run the configuration import.
  if ($config = drush_get_option('config-dir')) {
    // Set the destination site UUID to match the source UUID, to bypass a core fail-safe.
    $source_storage = new FileStorage($config);
    $options =['yes' TRUE];
    drush_invoke_process('@self', 'config-set', array('system.site', 'uuid', $source_storage->read('system.site')['uuid']), $options);
    // Run a full configuration import.
    drush_invoke_process('@self', 'config-import', array(), array('source' => $config) + $options);
  }
}