Aegir.php

Provides the Provision_Config_Drushrc_Aegir class.

Classes

Namesort descending Description
Provision_Config_Drushrc_Aegir Class for writing the /var/aegir/.drush/drushrc.php file.

File

Provision/Config/Drushrc/Aegir.php
View source
  1. <?php
  2. /**
  3. * @file
  4. * Provides the Provision_Config_Drushrc_Aegir class.
  5. */
  6. /**
  7. * Class for writing the /var/aegir/.drush/drushrc.php file.
  8. */
  9. class Provision_Config_Drushrc_Aegir extends Provision_Config_Drushrc {
  10. protected $context_name = 'home.drush';
  11. public $template = 'provision_drushrc_aegir.tpl.php';
  12. public $description = 'Aegir Drush configuration file';
  13. function __construct($context = '@none', $data = array()) {
  14. parent::__construct($context, $data);
  15. $this->load_data();
  16. }
  17. function load_data() {
  18. // List Hosting Features and their enabled status.
  19. $features = hosting_get_features();
  20. foreach ($features as $name => $info) {
  21. $enabled_features[$name] = $info['enabled'];
  22. }
  23. $this->data['hosting_features'] = $enabled_features;
  24. $this->data['drush_exclude'] = array();
  25. $this->data['drush_include'] = array();
  26. foreach($enabled_features as $feature => $status) {
  27. if ($status === '0') {
  28. $this->data['drush_exclude'][] = $feature;
  29. }
  30. else {
  31. $feature_include_path = DRUPAL_ROOT . '/' . drupal_get_path('module', $features[$feature]['module']) . '/drush';
  32. if (file_exists($feature_include_path)) {
  33. $this->data['drush_include'][$feature] = $feature_include_path;
  34. }
  35. }
  36. }
  37. }
  38. }