Aegir.php 850 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
<?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;
  }

}