Skip to content

Commit

Permalink
Fix '@bootstrap max' (#3403)
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-1-anderson authored Feb 20, 2018
1 parent 34a0ece commit acf3798
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/Boot/BootstrapManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,17 @@ public function bootstrapToPhase($bootstrapPhase, AnnotationData $annotationData
return $this->bootstrapToPhaseIndex($phase, $annotationData);
}

protected function maxPhaseLimit($bootstrap_str)
{
$bootstrap_words = explode(' ', $bootstrap_str);
array_shift($bootstrap_words);
if (empty($bootstrap_words)) {
return null;
}
$stop_phase_name = array_shift($bootstrap_words);
return $this->bootstrap()->lookUpPhaseIndex($stop_phase_name);
}

/**
* Bootstrap to the specified phase.
*
Expand All @@ -423,9 +434,7 @@ public function bootstrapToPhaseIndex($max_phase_index, AnnotationData $annotati
if ($max_phase_index == DRUSH_BOOTSTRAP_MAX) {
// Try get a max phase.
$bootstrap_str = $annotationData->get('bootstrap');
if ($stop_phase = array_pop(explode(' ', $bootstrap_str))) {
$stop_phase = $this->bootstrap()->lookUpPhaseIndex($stop_phase);
}
$stop_phase = $this->maxPhaseLimit($bootstrap_str);
$this->bootstrapMax($stop_phase);
return true;
}
Expand Down

0 comments on commit acf3798

Please sign in to comment.