verify.provision.inc 2.13 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
<?php

/**
 * Provision verify command
 *
 * Disable an enabled and installed site
 */
function provision_drupal_provision_verify_validate() {
  // 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
 */
17
function provision_drupal_provision_verify($url = null) {
18
  if (PROVISION_CONTEXT_PLATFORM) {
19 20 21
    _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"),
22
      dt("Drupal sites directory is not writable by the provisioning script"), PROVISION_SITES_DIR_NOT_WRITABLE);
23

24 25 26
    drush_set_option('sites', array_keys((array) provision_drupal_find_sites()), 'platform'); 
    drush_set_option('platform', array('short_name' => 'drupal', 'version' => drush_drupal_version()), 'platform'); 
    print_r(_drush_get_context());
27
    drush_log(dt("This platform is running @short_name @version", 
28
      array('@short_name' => 'drupal', '@version' => VERSION)));
29 30
    drush_set_option('profiles', _scrub_object(_provision_find_profiles()), 'platform');

31 32 33
  }
  else {
      // This is the actual drupal provisioning requirements. 
34 35
    _provision_drupal_create_directories($url);
    _provision_drupal_maintain_aliases($url);
36
    // Requires at least the database settings to complete.
37 38 39
   _provision_drupal_create_settings_file($url);
    provision_internal_init($url);
    provision_platform_include(dirname(__FILE__), 'verify');
40
  }
41
  #if (is_array($data['modules'])) {
42
    // get the correct version names for everything.
43
    #$data['modules'] = _provision_drupal_get_cvs_versions($data['modules']);
44
  #}
45 46 47 48 49 50
}


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