verify.provision.inc 2.16 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
<?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
 */
function provision_drupal_provision_verify(&$data, $url = null) {
  if (PROVISION_CONTEXT_PLATFORM) {
19 20 21 22
    _provision_create_dir(PROVISION_CONFIG_PATH, dt('Provision configuration'), 0700);
    _provision_create_dir(PROVISION_BACKUP_PATH, dt('Web server configuration'), 0700);
    provision_path("writable", "sites", TRUE, dt("Drupal sites directory is writable by the provisioning script"),
      dt("Drupal sites directory is not writable by the provisioning script"), PROVISION_PERM_ERROR);
23 24
    $data['sites'] = array_keys((array) provision_drupal_find_sites()); // return list of hosted sites. used to determine whether or not to import. 

25 26
    $data['platform'] = array('short_name' => 'drupal', 'version' => drush_drupal_version());  
    provision_log('notice', dt("This platform is running @short_name @version", 
27 28 29 30 31 32 33 34 35 36
      array('@short_name' => 'drupal', '@version' => VERSION)));
    $data['profiles'] = _provision_find_profiles();
    $cmd = sprintf("php %s/drupal_verify.php", dirname(__FILE__)); 
  }
  else {
      // This is the actual drupal provisioning requirements. 
    _provision_drupal_create_directories($url, $data['profile']);
    _provision_drupal_maintain_aliases($data, $url);
    // Requires at least the database settings to complete.
    _provision_drupal_create_settings_file($data, $url);
37 38
    #$cmd = sprintf("php %s/drupal_verify.php %s", dirname(__FILE__), $url); 
    #provision_exec($cmd, $data);
39 40 41
  }
  if (is_array($data['modules'])) {
    // get the correct version names for everything.
42
    #$data['modules'] = _provision_drupal_get_cvs_versions($data['modules']);
43 44 45 46 47 48 49 50 51 52 53 54 55 56
  }
}


/**
 * Implementation of hook_provision_post_verify
 */
function provision_drupal_provision_post_verify(&$data, $url = NULL) {
  if (PROVISION_CONTEXT_SITE) {
    _provision_drupal_rebuild_caches($data, $url);
    $data['installed'] = TRUE;
  }
}