CoreFiles by mySites.guru
CleanCacheCommand.php62 lines, 1,348 bytes, from Joomla_4.0.0-alpha2-Alpha-Full_Package.zip
Raw History Compare with 3.10.0-alpha9
md5
56a9177230922da762dc0bf6fd64b406
sha1
ba2e542455f76ec1950b3f3d189176e816839369
sha256
18ec5fc72e4506b70f7201117f061f859896887820c5f332d5fc1c82d7dc0988
<?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\Factory;
use Joomla\Console\AbstractCommand;
use Symfony\Component\Console\Style\SymfonyStyle;

/**
 * Console command for cleaning the system cache
 *
 * @since  __DEPLOY_VERSION__
 */
class CleanCacheCommand 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('Cleaning System Cache');

		Factory::getCache()->gc();

		$symfonyStyle->success('Cache cleaned');

		return 0;
	}

	/**
	 * Initialise the command.
	 *
	 * @return  void
	 *
	 * @since   __DEPLOY_VERSION__
	 */
	protected function initialise()
	{
		$this->setName('cache:clean');
		$this->setDescription('Cleans expired cache entries');
		$this->setHelp(<<<EOF
The <info>%command.name%</info> command cleans the system cache of expired entries

<info>php %command.full_name%</info>
EOF
		);
	}
}

No other release has this exact content. See every version of this file.