http.drush.inc 2.71 KB
Newer Older
1 2 3 4
<?php

include_once(dirname(__FILE__) . '/../provision.service.inc');

5 6 7 8 9
class provisionService_http extends provisionService {
  /**
   * Set defaults
   */
  function __construct() {
10 11
    // Set up defines for platform
    $docroot = drush_get_option(array("r", "root"), $_SERVER['PWD']);
12

13
    $path = drush_set_default('publish_path', rtrim(($docroot) ? $docroot : $_SERVER['DOCUMENT_ROOT'], '/'));
14
    drush_set_default('sites_path', $path . '/sites');
15
    drush_set_default('publish_path', realpath(drush_get_option('publish_path')));
16 17 18

    $parts = explode("/", $path);
    array_pop($parts);
19
    drush_set_default('parent_path', implode("/" , $parts));
20

21
    $parent_path = drush_get_option('parent_path');
22 23 24 25 26 27 28 29 30 31 32 33
    drush_set_default('backup_path', $parent_path . '/backups');
    drush_set_default('config_path', $parent_path . '/config');

    $config_path = drush_get_option('config_path');
    drush_set_default('vhost_path', $config_path . '/vhost.d');
    drush_set_default('platform_conf_path', $config_path . '/platform.d');

    // Commands
    drush_set_default('restart_cmd', _provision_default_restart_cmd());

    // System account
    drush_set_default('web_group', _provision_default_web_group());
anarcat's avatar
anarcat committed
34 35
    $pw = posix_getpwuid(posix_geteuid());
    drush_set_default('script_user', $pw['name']);
36 37 38 39 40 41 42 43 44 45 46 47

    // Redirection urls
    drush_set_default('master_url', $GLOBALS['base_url']);
    $master_url = drush_get_option('master_url');
    drush_set_default('web_disable_url', $master_url .'/hosting/disabled');
    drush_set_default('web_maintenence_url', $master_url .'/hosting/maintenance');

    drush_set_default('web_ip', '127.0.0.1');
    drush_set_default('web_port', 80);

    drush_set_default('site_port', 80);
  }
48

49 50 51
  /**
   * Ask the web server to check for and load configuration changes.
   */
52
  function parse_configs() {
53
    return TRUE;
54 55
  }

56 57 58
  /**
   * Generate a site specific configuration file
   */
59
  function create_site_config() {
60
    return TRUE;
61 62
  }

63 64 65
  /**
   * Remove an existing site configuration file.
   */
66
  function delete_site_config() {
67
    return TRUE;
68 69
  }

70 71 72
  /**
   * Add a new platform specific configuration file.
   */
73
  function create_platform_config() {
74
    return TRUE;
75 76
  }

77 78 79
  /**
   * Remove an existing platform configuration file.
   */
80
  function delete_platform_config() {
81
    return TRUE;
82 83
  }

84 85 86
  /**
   * Create a new server specific configuration file.
   */
87
  function create_server_config() {
88
    return TRUE;
89 90
  }

91 92 93
  /**
   * Remove an existing server specific configuration file
   */
94
  function delete_server_config() {
95
    return TRUE;
96
  }
drumm's avatar
drumm committed
97 98 99 100 101

  /**
   * Write out server's drushrc alias file.
   */
  function write_alias() {
102
    return array('provision-service-http', 'web_ports', 'web_group', 'restart_cmd');
drumm's avatar
drumm committed
103
  }
104
}