- md5
- c65632c776f2c8b691d7a0d826ea378a
- sha1
- 343636f14b30687d8cb0cf59b6edbd6fa51b0dd7
- sha256
- c22652d5f5db204d02a00f0a8a8c413f2e16b7862d8ce187af916c3c6020053d
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
<?php
/**
* Joomla! Content Management System
*
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\CMS\Console;
defined('JPATH_PLATFORM') or die;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Updater\Updater;
use Joomla\Console\AbstractCommand;
use Symfony\Component\Console\Style\SymfonyStyle;
/**
* Console command for checking if there are pending extension updates
*
* @since __DEPLOY_VERSION__
*/
class CheckUpdatesCommand extends AbstractCommand
{
/**
* Execute the command.
*
* @return integer The exit code for the command.
*
* @since __DEPLOY_VERSION__
*/
public function execute(): int
{
$symfonyStyle = new SymfonyStyle($this->getApplication()->getConsoleInput(), $this->getApplication()->getConsoleOutput());
$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
Updater::getInstance()->findUpdates(0, $cache_timeout);
$symfonyStyle->success('Finished fetching updates');
return 0;
}
/**
* Initialise the command.
*
* @return void
*
* @since __DEPLOY_VERSION__
*/
protected function initialise()
{
$this->setName('update:extensions:check');
$this->setDescription('Checks for pending extension updates');
$this->setHelp(<<<EOF
The <info>%command.name%</info> command checks for pending extension updates
<info>php %command.full_name%</info>
EOF
);
}
}
No other release has this exact content. See every version of this file.