summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Rossouw2010-06-24 22:49:24 (GMT)
committerAdrian Rossouw2010-06-24 22:49:24 (GMT)
commitf7f88620df7dc26848d59c0ed4df4694ca874ef3 (patch)
treecb5f71ddb5b8425e3978eb400ac71aba06f146bb
parent1cbfe6b2a57706e7cb053e1088cd9fb4ac3c02ed (diff)
Completed getting rid of site port.dev-ports
-rw-r--r--http/apache/apache_service.inc4
-rw-r--r--http/apache/server.tpl.php4
-rw-r--r--http/apache/vhost.tpl.php2
-rw-r--r--http/apache/vhost_redirect.tpl.php2
-rw-r--r--install.hostmaster.inc1
-rw-r--r--platform/drupal/install_5.inc23
-rw-r--r--platform/drupal/install_6.inc24
-rw-r--r--platform/drupal/install_7.inc9
-rw-r--r--provision.environment.inc2
-rw-r--r--provision.inc15
10 files changed, 37 insertions, 49 deletions
diff --git a/http/apache/apache_service.inc b/http/apache/apache_service.inc
index 8d2ddd8..736e787 100644
--- a/http/apache/apache_service.inc
+++ b/http/apache/apache_service.inc
@@ -87,7 +87,7 @@ class provisionService_http_apache extends provisionService_http {
$config = new provisionConfig_apache_server($this->context, $this->config_data());
$config->write();
-
+ dlm($config->filename());
// Create a symlink to the site specific apache config in the top level config directory of each server.
// This way you can still include the same file across all servers.
@@ -166,7 +166,7 @@ class provisionConfig_apache_site extends provisionConfig_apache {
public $description = 'apache site configuration file';
function filename() {
- return $this->data['apache_site_conf_path'] . '/' . $this->uri . '_' . $this->data['http_port'];
+ return $this->data['apache_site_conf_path'] . '/' . $this->uri;
}
function process() {
diff --git a/http/apache/server.tpl.php b/http/apache/server.tpl.php
index 174b013..f22f70a 100644
--- a/http/apache/server.tpl.php
+++ b/http/apache/server.tpl.php
@@ -1,8 +1,8 @@
# Aegir web server configuration file
-NameVirtualHost *:<?php print $web_port; ?>
+NameVirtualHost *:<?php print $http_port; ?>
-<VirtualHost *:<?php print $web_port; ?>>
+<VirtualHost *:<?php print $http_port; ?>>
ServerName default
Redirect 404 /
</VirtualHost>
diff --git a/http/apache/vhost.tpl.php b/http/apache/vhost.tpl.php
index 015387e..091e475 100644
--- a/http/apache/vhost.tpl.php
+++ b/http/apache/vhost.tpl.php
@@ -1,4 +1,4 @@
-<VirtualHost *:<?php print $this->site_port; ?>>
+<VirtualHost *:<?php print $http_port; ?>>
<?php if ($this->site_mail) : ?>
ServerAdmin <?php print $this->site_mail; ?>
<?php endif;?>
diff --git a/http/apache/vhost_redirect.tpl.php b/http/apache/vhost_redirect.tpl.php
index dc8d43f..28dc27f 100644
--- a/http/apache/vhost_redirect.tpl.php
+++ b/http/apache/vhost_redirect.tpl.php
@@ -1,4 +1,4 @@
-<VirtualHost *:<?php print $this->site_port; ?>>
+<VirtualHost *:<?php print $http_port; ?>>
<?php if ($this->site_mail) : ?>
ServerAdmin <?php print $this->site_mail; ?>
<?php endif;?>
diff --git a/install.hostmaster.inc b/install.hostmaster.inc
index be43acf..71e8ba5 100644
--- a/install.hostmaster.inc
+++ b/install.hostmaster.inc
@@ -92,7 +92,6 @@ function drush_provision_hostmaster_install($site = NULL) {
'db_server' => $server,
'uri' => $site,
'client_email' => $client_email,
- 'site_port' => drush_get_option('web_port', 80),
'profile' => 'hostmaster',
));
$data = provision_backend_invoke($site_name, 'provision-install');
diff --git a/platform/drupal/install_5.inc b/platform/drupal/install_5.inc
index 47fabae..68bee33 100644
--- a/platform/drupal/install_5.inc
+++ b/platform/drupal/install_5.inc
@@ -4,25 +4,12 @@
* Rebuild all the caches
*/
-$GLOBALS['url'] = drush_get_option('uri');
-$GLOBALS['profile'] = drush_get_option('profile');
-$GLOBALS['install_locale'] = drush_get_option('language');
-$GLOBALS['client_email'] = drush_get_option('client_email');
+$GLOBALS['url'] = d()->uri;
+$GLOBALS['profile'] = d()->profile;
+$GLOBALS['install_locale'] = d()->language;
+$GLOBALS['client_email'] = d()->client_email;
+$GLOBALS['base_url'] = provision_get_base_url();
-// url generation code, should be factored out
-$proto = drush_get_option('ssl') ? 'https' : 'http';
-if (drush_get_option('site_port') == 80) {
- if (drush_get_option('ssl')) {
- $GLOBALS['base_url'] = $proto . '://' . $GLOBALS['url'] . ':80';
- }
-}
-elseif (drush_get_option('site_port') == 443) {
- if (!drush_get_option('ssl')) {
- $GLOBALS['base_url'] = $proto . '://' . $GLOBALS['url'] . ':443';
- }
-} else {
- $GLOBALS['base_url'] = $proto . '://' . $GLOBALS['url'] . ':' . drush_get_option('site_port');
-}
require_once 'includes/install.inc';
diff --git a/platform/drupal/install_6.inc b/platform/drupal/install_6.inc
index 16d13c1..3040340 100644
--- a/platform/drupal/install_6.inc
+++ b/platform/drupal/install_6.inc
@@ -4,24 +4,12 @@
* Rebuild all the caches
*/
-$GLOBALS['url'] = drush_get_option('uri');
-$GLOBALS['profile'] = drush_get_option('profile');
-$GLOBALS['install_locale'] = drush_get_option('language');
-$GLOBALS['client_email'] = drush_get_option('client_email');
-// url generation code, should be factored out
-$proto = drush_get_option('ssl') ? 'https' : 'http';
-if (drush_get_option('site_port') == 80) {
- if (drush_get_option('ssl')) {
- $GLOBALS['base_url'] = $proto . '://' . $GLOBALS['url'] . ':80';
- }
-}
-elseif (drush_get_option('site_port') == 443) {
- if (!drush_get_option('ssl')) {
- $GLOBALS['base_url'] = $proto . '://' . $GLOBALS['url'] . ':443';
- }
-} else {
- $GLOBALS['base_url'] = $proto . '://' . $GLOBALS['url'] . ':' . drush_get_option('site_port');
-}
+$GLOBALS['url'] = d()->uri;
+$GLOBALS['profile'] = d()->profile;
+$GLOBALS['install_locale'] = d()->language;
+$GLOBALS['client_email'] = d()->client_email;
+$GLOBALS['base_url'] = provision_get_base_url();
+
require_once 'includes/install.inc';
define('MAINTENANCE_MODE', 'install');
diff --git a/platform/drupal/install_7.inc b/platform/drupal/install_7.inc
index f397a7b..484030f 100644
--- a/platform/drupal/install_7.inc
+++ b/platform/drupal/install_7.inc
@@ -4,10 +4,11 @@
* Rebuild all the caches
*/
-$GLOBALS['url'] = drush_get_option('uri');
-$GLOBALS['profile'] = drush_get_option('profile');
-$GLOBALS['install_locale'] = drush_get_option('language');
-$GLOBALS['client_email'] = drush_get_option('client_email');
+$GLOBALS['url'] = d()->uri;
+$GLOBALS['profile'] = d()->profile;
+$GLOBALS['install_locale'] = d()->language;
+$GLOBALS['client_email'] = d()->client_email;
+$GLOBALS['base_url'] = provision_get_base_url();
define('MAINTENANCE_MODE', 'install');
diff --git a/provision.environment.inc b/provision.environment.inc
index a144d71..9f65978 100644
--- a/provision.environment.inc
+++ b/provision.environment.inc
@@ -496,7 +496,6 @@ class provisionSite extends provisionEnvironment {
'--platform' => 'site: the platform the site is run on',
'--db_server' => 'site: the db server the site is run on',
'--uri' => 'site: example.com URI, no http:// or trailing /',
- '--site_port' => 'site: port the site is hosted on; default 80',
'--language' => 'site: site language; default en',
'--aliases' => 'site: comma-separated URIs',
'--redirection' => 'site: boolean for whether --aliases should redirect; default false',
@@ -523,7 +522,6 @@ class provisionSite extends provisionEnvironment {
$this->setProperty('site_enabled', true);
$this->setProperty('language', 'en');
- $this->setProperty('site_port', 80);
$this->setProperty('client_email');
$this->setProperty('aliases', array(), TRUE);
$this->setProperty('redirection', FALSE);
diff --git a/provision.inc b/provision.inc
index 2dc68fc..ad79a8e 100644
--- a/provision.inc
+++ b/provision.inc
@@ -47,6 +47,21 @@ function provision_is_local_host($host) {
}
/**
+ * Retrieve a base_url for the currently active site.
+ *
+ * TODO: when we actually support HTTPS, do this correctly.
+ */
+function provision_get_base_url() {
+ $base_url = 'http://' . d()->uri;
+
+ $http_port = d()->web_server->http_port;
+ if (!is_null($http_port) && ($http_port != 80)) {
+ $base_url .= ':' . $http_port;
+ }
+ return $base_url;
+}
+
+/**
* Save modified options to the drushrc.php file
*/
function provision_save_server_data() {