/[drupal]/contributions/modules/provision/platform/install.provision.inc
ViewVC logotype

Contents of /contributions/modules/provision/platform/install.provision.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.17 - (show annotations) (download) (as text)
Mon Oct 19 16:05:18 2009 UTC (5 weeks, 6 days ago) by adrian
Branch: MAIN
Changes since 1.16: +2 -2 lines
File MIME type: text/x-php
Initial D7 install task support. does not work due to exception handling issue in core
1 <?php
2 /**
3 * @file
4 * Provision hooks for the provision install command.
5 */
6
7 /**
8 * Provision install command
9 *
10 * These are the hooks that will be executed by the drush_invoke function
11 * when doing a provision_install.
12 */
13
14 /**
15 * Check that we are trying to install a new site , and a new site only
16 */
17 function drush_provision_drupal_provision_install_validate($url) {
18 if (!$url) {
19 return drush_set_error("PROVISION_URL_REQUIRED", dt("You need to specify a valid url to install a site"));
20 }
21 if (drush_get_option('installed')) {
22 drush_set_error('PROVISION_SITE_INSTALLED');
23 }
24 }
25
26 /**
27 * Set up the directories and settings.php file that we need.
28 */
29 function drush_provision_drupal_pre_provision_install($url) {
30 // This is the actual drupal provisioning requirements.
31 _provision_drupal_create_directories($url);
32 }
33
34 /**
35 * Install Drupal with the pre-configured settings, by calling an external script
36 *
37 * This is an external script so that php is running in it's own namespace, and
38 * weird problems such as the multiple database connections don't confuse drupal.
39 */
40 function drush_provision_drupal_provision_install($url) {
41 // Requires at least the database settings to complete.
42 _provision_drupal_create_settings_file($url);
43 drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_SITE);
44 drush_include_engine('drupal', 'install');
45 drush_set_option('installed', TRUE, 'site');
46 _provision_drupal_maintain_aliases($url);
47 }
48
49 /**
50 * If the install went south, and the site is not PROVISION_SITE_INSTALLED, clean up behind ourselves
51 */
52 function drush_provision_drupal_provision_install_rollback($url) {
53 if (!drush_cmp_error('PROVISION_SITE_INSTALLED')) {
54 if ($url) {
55 _provision_recursive_delete("sites/$url");
56 } else {
57 drush_set_error('PROVISION_FRAMEWORK_ERROR', dt('no url defined in %function', array('%function' => __FUNCTION__)));
58 }
59 }
60 }
61
62
63 /**
64 * Finish the installation, regenerate the caches on the site so that
65 * any changes to things such as available modules/ themes can take affect.
66 */
67 function drush_provision_drupal_post_provision_install($url) {
68 drush_set_option('aliases', drush_get_option('aliases'), 'site');
69 drush_set_option('installed', TRUE, 'site');
70 provision_path("chmod", "./sites/$url/settings.php", 0440, dt("Secured settings.php with safe permissions"));
71 #_provision_drupal_rebuild_caches($url);
72 #drush_set_option('packages', _scrub_object(provision_drupal_system_map()), 'site');
73 }
74

  ViewVC Help
Powered by ViewVC 1.1.2