Commit d5a12803 authored by mig5's avatar mig5 Committed by mig5

#1016890 reapply contributed patch for fixing infinite loop - the reason it...

#1016890 reapply contributed patch for fixing infinite loop - the reason it broke under Drush 4 was that I blew away our incorporation of the new cli context
parent 28b81037
......@@ -77,7 +77,7 @@ function provision_context_factory($name) {
$type = 'server';
$record = provision_sitealias_get_record($name);
$options = array_merge(drush_get_context('stdin'), drush_get_context('options'), drush_get_context('cli'));
$options = ($name == '@self') ? array_merge(drush_get_context('stdin'), drush_get_context('options'), drush_get_context('cli')) : array();
if (isset($record['context_type'])) {
$type = $record['context_type'];
......@@ -133,7 +133,13 @@ class provisionContext {
*/
function __get($name) {
if ($name == 'options') {
return array_merge(provision_sitealias_get_record($this->name), array_filter(drush_get_context('stdin')), array_filter(drush_get_context('options')), array_filter(drush_get_context('cli')));
$record = provision_sitealias_get_record($this->name);
if ($this->name == '@self') {
return array_merge($record, array_filter(drush_get_context('stdin')), array_filter(drush_get_context('options')), array_filter(drush_get_context('cli')));
}
else {
return $record;
}
}
if (array_key_exists($name, $this->properties)) {
if (isset($this->oid_map[$name]) && !empty($this->properties[$name])) {
......
......@@ -223,10 +223,15 @@ function drush_provision_save($alias = null) {
$config->unlink();
}
else {
// rename @self and save.
d()->name = $alias;
// trigger additional logic that should happen only on save.
d($alias)->type_invoke('save');
d()->type_invoke('save');
// create or update the record
d($alias)->write_alias();
d()->write_alias();
}
}
......
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