import.provision.inc 1.27 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
<?php

/**
 * Provision import command
 *
 * Import existing drupal sites
 */


/**
 * Import the information about the existing site, and return it in the $data context array
 */
13
function drush_provision_drupal_provision_import() {
14 15 16 17 18 19 20 21 22
  if (d()->type === 'site') {
    drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_FULL);
    drush_include_engine('drupal', 'import', drush_drupal_major_version());
    drush_set_option('installed', TRUE, 'site');
  }
}

function drush_provision_drupal_post_provision_import() {
  if (d()->type === 'site') {
23 24
    d()->profile = drush_set_option('profile', drush_get_option('profile', 'default', 'site'));
    d()->language = drush_set_option('language', drush_get_option('language', 'en', 'site'));
25
    d()->aliases = drush_set_option('aliases', provision_drupal_find_aliases());
26 27
    d()->write_alias();

28 29 30
    // set this in the site options too so it recurrs.
    drush_set_option('aliases', drush_get_option('aliases'),  'site');

31 32 33
    // generate the drushrc
    provision_save_site_data();

34 35 36
    // Do not automatically save the drushrc at the end of the command.
    drush_set_option('provision_save_config', false);

37
    provision_backend_invoke(d()->name, 'provision-verify');
38
    
39
    drush_include_engine('drupal', 'cron_key');
40 41

    provision_reload_config('site');
42
  }
43 44
}