protected function execute(InputInterface $input, OutputInterface $output)
{
$this->output = $output;
$this->version = $this->getApplication()->getVersion();
$parser = new VersionParser();
/*
* Check for ancilliary options
*/
if ($input->getOption('rollback')) {
$this->rollback();
return;
}
if ($input->getOption('check')) {
$this->printAvailableUpdates();
return;
}
/*
* Update to any specified stability option
*/
if ($input->getOption('dev')) {
$this->updateToDevelopmentBuild();
return;
}
if ($input->getOption('pre')) {
$this->updateToPreReleaseBuild();
return;
}
if ($input->getOption('stable')) {
$this->updateToStableBuild();
return;
}
if ($input->getOption('non-dev')) {
$this->updateToMostRecentNonDevRemote();
return;
}
/*
* If current build is stable, only update to more recent stable
* versions if available. User may specify otherwise using options.
*/
if ($parser->isStable($this->version)) {
$this->updateToStableBuild();
return;
}
/*
* By default, update to most recent remote version regardless
* of stability.
*/
$this->updateToMostRecentNonDevRemote();
}