/**
* Internal function to execute the command.
*
* @param InputInterface $input The input to inject into the command.
* @param OutputInterface $output The output to inject into the command.
*
* @return integer The command exit code
*
* @since 4.0.0
*/
protected function doExecute(InputInterface $input, OutputInterface $output) : int
{
$symfonyStyle = new SymfonyStyle($input, $output);
$symfonyStyle->title('Fetching Extension Updates');
// Get the update cache time
$component = ComponentHelper::getComponent('com_installer');
$cache_timeout = 3600 * (int) $component->getParams()->get('cachetimeout', 6);
// Find all updates
$ret = Updater::getInstance()->findUpdates(0, $cache_timeout);
if ($ret) {
$symfonyStyle->note('There are available updates to apply');
$symfonyStyle->success('Check complete.');
} else {
$symfonyStyle->success('There are no available updates');
}
return Command::SUCCESS;
}