public function doExecute(InputInterface $input, OutputInterface $output) : int
{
$this->configureIO($input, $output);
$this->progressBar->setMessage("Starting up ...");
$this->progressBar->start();
$model = $this->getUpdateModel();
$this->setUpdateInfo($model->getUpdateInformation());
$this->progressBar->advance();
$this->progressBar->setMessage('Running checks ...');
if (!$this->updateInfo['hasUpdate']) {
$this->progressBar->finish();
$this->ioStyle->note('You already have the latest Joomla! version. ' . $this->updateInfo['latest']);
return self::ERR_CHECKS_FAILED;
}
$this->progressBar->advance();
$this->progressBar->setMessage('Starting Joomla! update ...');
if ($this->updateJoomlaCore($model)) {
$this->progressBar->finish();
$this->ioStyle->success('Joomla core updated successfully!');
return self::UPDATE_SUCCESSFUL;
}
$this->progressBar->finish();
$this->ioStyle->error('Update cannot be performed.');
return self::ERR_UPDATE_FAILED;
}