Commit ccb00503 authored by Adrian Rossouw's avatar Adrian Rossouw

Added a first try at an alias writer class.

we need a mechanism to load the config though.
parent e5945277
......@@ -114,7 +114,10 @@ class provisionConfig_drushrc extends provisionConfig {
function __construct($data = array()) {
parent::__construct($data);
$this->load_data();
}
function load_data() {
// we fetch the context to pass into the template based on the context name
$this->data = array_merge(drush_get_context($this->context_name), $this->data);
}
......@@ -126,6 +129,31 @@ class provisionConfig_drushrc extends provisionConfig {
}
}
// class to read and write an alias record
class provisionConfig_drushrc_alias extends provisionConfig_drushrc {
function __construct($aliasname, $data = array()) {
parent::construct($data);
$this->alias_name = $aliasname;
}
function load_data() {
// do something about alias_load_data
}
function filename() {
return drush_get_option('alias-path', drush_server_home() . '/.drush/aliases/') . trim($this->aliasname, '@');
}
}
/**
* Server level config for drushrc.php files.
*/
class provisionConfig_drushrc_server extends provisionconfig_drushrc {
protected $context_name = 'home.drush';
public $description = 'Server drush configuration';
}
/**
* Class for writing $platform/drushrc.php files.
*/
......
......@@ -315,4 +315,3 @@ function provision_load_critical($load = null, $threshold = null) {
return ($load[0] > $threshold);
}
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