verify.provision.inc 2.12 KB
Newer Older
1 2 3 4 5 6 7
<?php

/**
 * Provision verify command
 *
 * Disable an enabled and installed site
 */
8 9 10 11 12
function provision_drupal_provision_verify_validate($url = null) {
  if ($url) {
    drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_FULL);
  }

13 14 15 16 17 18 19 20
  // This will not have an effect if you are running it on a platform, just tests that if a site is provided it is an existing one
  _provision_drupal_valid_site();
}


/**
 * implementation of provision_verify
 */
21
function provision_drupal_provision_verify($url = null) {
22
  if (PROVISION_CONTEXT_PLATFORM) {
23 24 25
    _provision_create_dir(drush_get_option('config_path'), dt('Provision configuration'), 0700);
    _provision_create_dir(drush_get_option('backup_path'), dt('Web server configuration'), 0700);
    provision_path("writable", drush_get_option('sites_path'), TRUE, dt("Drupal sites directory is writable by the provisioning script"),
26
      dt("Drupal sites directory is not writable by the provisioning script"), PROVISION_SITES_DIR_NOT_WRITABLE);
27

28 29
    drush_set_option('sites', array_keys((array) provision_drupal_find_sites()), 'drupal'); 
    drush_set_option('platform', array('short_name' => 'drupal', 'version' => drush_drupal_version())); 
30
    drush_log(dt("This platform is running @short_name @version", 
31
      array('@short_name' => 'drupal', '@version' => VERSION)));
32
    drush_set_option('profiles', _scrub_object(_provision_find_profiles()), 'drupal');
33

34 35 36
  }
  else {
      // This is the actual drupal provisioning requirements. 
37 38
    _provision_drupal_create_directories($url);
    _provision_drupal_maintain_aliases($url);
39
    // Requires at least the database settings to complete.
40
   _provision_drupal_create_settings_file($url);
41

42
    provision_platform_include(dirname(__FILE__), 'verify');
43
  }
44
  #if (is_array($data['modules'])) {
45
    // get the correct version names for everything.
46
    #$data['modules'] = _provision_drupal_get_cvs_versions($data['modules']);
47
  #}
48 49 50 51 52 53
}


/**
 * Implementation of hook_provision_post_verify
 */
54
function provision_drupal_provision_post_verify($url = NULL) {
55
  if (PROVISION_CONTEXT_SITE) {
56 57
    _provision_drupal_rebuild_caches($url);
    drush_set_option('installed', TRUE, 'site');
58 59 60
  }
}