delete.provision.inc

  1. 7.x-3.x dns/delete.provision.inc
  2. 7.x-3.x platform/delete.provision.inc
  3. 7.x-3.x db/delete.provision.inc
  4. 7.x-3.x http/delete.provision.inc

Functions

Namesort descending Description
drush_provision_drupal_pre_provision_delete Before starting to delete the site, make a backup
drush_provision_drupal_provision_delete If we're deleting a site, remove any directories for the site in sites folder If we're deleting a platform, remove the whole platform This can't be rolled back. so won't even try.

File

platform/delete.provision.inc
View source
  1. <?php
  2. /**
  3. * Before starting to delete the site, make a backup
  4. */
  5. function drush_provision_drupal_pre_provision_delete($backup_file = NULL) {
  6. if (d()->type === 'site') {
  7. drush_set_option('force', true, 'process');
  8. drush_invoke("provision-backup", $backup_file);
  9. drush_unset_option('force', 'process');
  10. }
  11. }
  12. /**
  13. * If we're deleting a site, remove any directories for the site in sites folder
  14. * If we're deleting a platform, remove the whole platform
  15. * This can't be rolled back. so won't even try.
  16. */
  17. function drush_provision_drupal_provision_delete() {
  18. if (d()->type === 'site') {
  19. drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_ROOT);
  20. drush_invoke_process('@none', 'provision-save', array(d()->name), array('delete' => TRUE));
  21. foreach (d()->drush_aliases as $alias) {
  22. drush_invoke_process('@none', 'provision-save', array($alias), array('delete' => TRUE));
  23. }
  24. // Do not automatically save the drushrc at the end of the command.
  25. drush_set_option('provision_save_config', false);
  26. _provision_recursive_delete(d()->site_path);
  27. // we remove the aliases even if redirection is enabled as a precaution
  28. // if redirection is enabled, keep silent about errors
  29. _provision_drupal_delete_aliases();
  30. // Remove the symlink in the clients directory.
  31. _provision_client_delete_symlink();
  32. provision_drupal_push_site($override_slave_authority = TRUE);
  33. }
  34. elseif (d()->type === 'platform') {
  35. if (!drush_get_option('force', FALSE) && drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_ROOT) && provision_drupal_find_sites()) {
  36. drush_set_error(dt('Existing sites were found on this platform. These sites will need to be deleted before this platform can be deleted.'));
  37. }
  38. else {
  39. _provision_recursive_delete(d()->root);
  40. d()->service('http')->sync(d()->root);
  41. }
  42. }
  43. }