Commit 2196d0f7 authored by ergonlogic's avatar ergonlogic

Merge branch 'dev/2098389' into 6.x-2.x

parents 9b8a9ba0 4fde44bc
<?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()));
}
......@@ -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();
}
}
......
<?php
/**
* Implements hook_drush_load().
*
* Checks if the corresponsing Hosting Feature is enabled.
*/
function subdirs_drush_load() {
return in_array('subdirs', drush_get_option('hosting_features', array()));
}
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