delete.provision.inc 865 Bytes
Newer Older
1 2
<?php

3
function drush_http_provision_delete() {
drumm's avatar
drumm committed
4
  if (d()->type === 'site') {
5 6 7
    d()->service('http')->delete_config('site')
        ->succeed('Deleted platform configuration file', 'success')
        ->fail('Failed to delete platform configuration file', 'DRUSH_PERM_ERROR');
8
  }
drumm's avatar
drumm committed
9
  if (d()->type === 'platform') {
10
    if (!drush_get_option('force', FALSE) && drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_ROOT) && provision_drupal_find_sites()) {
11 12 13
      drush_set_error(dt('Existing sites were found on this platform. These sites will need to be deleted before this platform can be deleted.'));
    }
    else {
14 15 16
      d()->service('http')->delete_config('platform')
        ->succeed('Deleted platform configuration file', 'success')
        ->fail('Failed to delete platform configuration file', 'DRUSH_PERM_ERROR');
17 18
    }
  }
19
  d()->service('http')->parse_configs();
20
}