Commit 5d6120db authored by ergonlogic's avatar ergonlogic

Issue #2098389: Record enabled Hosting Features in /var/aegir/.drush/drushrc.php.

We want to be able to block unwanted Drush hooks from firing, especially those in
extensions where the front-end module is not enabled. To do so, we need to know
which Hosting Features are enabled very early in the Drush bootstrap process, since
blocking the unwanted hooks from firing is accomplished with hook_drush_load()'s.
parent 3f5d81c6
<?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) {
$features[$name] = $name;
}
else {
unset($features[$name]);
}
}
$this->data['hosting_features'] = $features;
}
}
<?php
/**
* @file
* Template file for an Aegir-wide drushrc file.
*/
print "<?php \n\n\$options['hosting_features'] = ". var_export($hosting_features, TRUE) . ";\n";
?>
......@@ -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