Created
April 13, 2010 18:32
-
-
Save AdrianRossouw/364918 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class provisionConfig_drushrc extends provisionConfig { | |
public $template = 'provision_drushrc.tpl.php'; | |
public $description = 'Drush configuration file'; | |
protected $mode = 0400; | |
protected $context_name = 'drush'; | |
function filename() { | |
return _drush_config_file($this->context_name); | |
} | |
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); | |
} | |
function process() { | |
unset($this->data['context-path']); | |
unset($this->data['config-file']); | |
$this->data['option_keys'] = array_keys($this->data); | |
} | |
} | |
// 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, '@'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment