install.provision.inc 1.9 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
/**
 * @file
 *   Provision hooks for the provision install command.
 */

/**
 * Provision install command
 *
 * These are the hooks that will be executed by the provision_invoke function
 * when doing a provision_install.
 */

/**
 * Check that we are trying to install a new site , and a new site only
 */
function provision_drupal_provision_install_validate() {
  _provision_drupal_url_required();
  _provision_drupal_valid_not_installed_site();
}

/**
 * Set up the directories and settings.php file that we need.
 */
25
function provision_drupal_provision_pre_install($url) {
26
 // This is the actual drupal provisioning requirements. 
27
 _provision_drupal_create_directories($url);
28
29
30
31
32
33
34
35
}

/**
 * Install Drupal with the pre-configured settings, by calling an external script
 *
 * This is an external script so that php is running in it's own namespace, and
 * weird problems such as the multiple database connections don't confuse drupal.
 */
36
function provision_drupal_provision_install($url) {
37
 // Requires at least the database settings to complete.
38
  _provision_drupal_create_settings_file($url);
39
  provision_internal_init($url, FALSE);
40
  provision_platform_include(dirname(__FILE__), 'install');
41
42
43
44
45
}

/**
 * If the install went south, and the site is not PROVISION_SITE_INSTALLED, clean up behind ourselves
 */
46
function provision_drupal_provision_install_rollback($url) {
47
  if (!(drush_get_error() & PROVISION_SITE_INSTALLED)) {
48
49
50
51
52
53
54
55
56
    _provision_recursive_delete("sites/$url");
  }
}


/**
 * Finish the installation, regenerate the caches on the site so that
 * any changes to things such as available modules/ themes can take affect.
 */
57
58
59
function provision_drupal_provision_post_install($url) {
  drush_set_option('installed', TRUE, 'site');
  _provision_drupal_maintain_aliases($url);
60
  provision_path("chmod", "./sites/$url/settings.php", 0440, dt("Secured settings.php with safe permissions"));
61
  _provision_drupal_rebuild_caches($url);
62
63
}