Commit 4bc723f2 authored by anarcat's avatar anarcat

Merge branch '6.x-2.x' into dev-subdir-multiserver

parents 48468e98 2196d0f7
<?php
/**
* @file
* Provides the Provision_Config_Drushrc_Aegir class.
*/
/**
* Class for writing the /var/aegir/.drush/drushrc.php file.
*/
class Provision_Config_Drushrc_Aegir extends Provision_Config_Drushrc {
protected $context_name = 'home.drush';
public $template = 'provision_drushrc_aegir.tpl.php';
public $description = 'Aegir Drush configuration file';
function __construct($context = '@none', $data = array()) {
parent::__construct($context, $data);
$this->load_data();
}
function load_data() {
// List enabled Hosting Features.
$features = hosting_get_features();
foreach ($features as $name => $info) {
if ($info['enabled'] == 1) {
$enabled_features[] = $name;
}
}
$this->data['hosting_features'] = $enabled_features;
}
}
<?php
/**
* @file
* Template file for an Aegir-wide drushrc file.
*/
print "<?php \n\n\$options['hosting_features'] = ". var_export($hosting_features, TRUE) . ";\n";
?>
<?php
/**
* Implements hook_drush_load().
*
* Checks if the corresponsing Hosting Feature is enabled.
*/
function dns_drush_load() {
return in_array('dns', drush_get_option('hosting_features', array()));
}
......@@ -74,8 +74,6 @@ function provision_drupal_drush_exit() {
/**
* Test to see if the site settings.php exists
*
* @param url
* The url of the site to check
* @return
* If the file exists, return TRUE, else return FALSE.
*/
......@@ -159,12 +157,6 @@ function provision_drupal_fetch_site() {
/**
* Generate a settings file for the site.
*
* @param url
* The url of the site being invoked.
* @param data
* A reference to the associated array containing the data for the site. This needs to be a reference,
* because the modules might provide additional information about the site.
*/
function _provision_drupal_create_settings_file() {
$config = new Provision_Config_Drupal_Settings(d()->name, drush_get_context('site'));
......@@ -175,8 +167,11 @@ function _provision_drupal_create_settings_file() {
* Create the directories needed to host a drupal site
*
* Also maintains permissions on existing directories.
*/
function _provision_drupal_create_directories($url = NULL, $profile = NULL) {
*
* @param $url
* The url of the site being invoked.
*/
function _provision_drupal_create_directories($url = NULL) {
if (is_null($url)) {
if (d()->type == 'site') {
$url = d()->uri;
......
......@@ -89,6 +89,13 @@ function drush_provision_drupal_pre_provision_verify() {
_provision_drupal_create_settings_file();
if (function_exists('hosting_get_features')) {
// We're verifying the hostmaster site, so record a list of enabled
// Hosting Features.
$aegir_drushrc = new Provision_Config_Drushrc_Aegir();
$aegir_drushrc->write();
}
provision_drupal_push_site();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment