PHP 8.1.33
Preview: CleanCacheCommand.php Size: 1.69 KB
/home/jambtst2015/public_html/ida.com.ng/libraries/src/Console/CleanCacheCommand.php

<?php
/**
 * Joomla! Content Management System
 *
 * @copyright  (C) 2017 Open Source Matters, Inc. <https://www.joomla.org>
 * @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\Command\AbstractCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;

/**
 * Console command for cleaning the system cache
 *
 * @since  4.0.0
 */
class CleanCacheCommand extends AbstractCommand
{
	/**
	 * The default command name
	 *
	 * @var    string
	 * @since  4.0.0
	 */
	protected static $defaultName = 'cache:clean';

	/**
	 * 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('Cleaning System Cache');

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

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

		return Command::SUCCESS;
	}

	/**
	 * Configure the command.
	 *
	 * @return  void
	 *
	 * @since   4.0.0
	 */
	protected function configure(): void
	{
		$help = "<info>%command.name%</info> will clear expired entries from the system cache
		\nUsage: <info>php %command.full_name%</info>";

		$this->setDescription('Clean expired cache entries');
		$this->setHelp($help);
	}
}

Directory Contents

Dirs: 1 × Files: 24

Name Size Perms Modified Actions
Loader DIR
- drwxr-xr-x 2024-11-22 17:53:12
Edit Download
6.91 KB lrw-r--r-- 2024-11-22 17:53:12
Edit Download
6.53 KB lrw-r--r-- 2024-11-22 17:53:12
Edit Download
3.78 KB lrw-r--r-- 2024-11-22 17:53:12
Edit Download
3.11 KB lrw-r--r-- 2024-11-22 17:53:12
Edit Download
2.17 KB lrw-r--r-- 2024-11-22 17:53:12
Edit Download
1.69 KB lrw-r--r-- 2024-11-22 17:53:12
Edit Download
4.56 KB lrw-r--r-- 2024-11-22 17:53:12
Edit Download
3.34 KB lrw-r--r-- 2024-11-22 17:53:12
Edit Download
5.50 KB lrw-r--r-- 2024-11-22 17:53:12
Edit Download
2.55 KB lrw-r--r-- 2024-11-22 17:53:12
Edit Download
5.05 KB lrw-r--r-- 2024-11-22 17:53:12
Edit Download
4.67 KB lrw-r--r-- 2024-11-22 17:53:12
Edit Download
5.20 KB lrw-r--r-- 2024-11-22 17:53:12
Edit Download
12.47 KB lrw-r--r-- 2024-11-22 17:53:12
Edit Download
7.36 KB lrw-r--r-- 2024-11-22 17:53:12
Edit Download
3.05 KB lrw-r--r-- 2024-11-22 17:53:12
Edit Download
4.10 KB lrw-r--r-- 2024-11-22 17:53:12
Edit Download
7.00 KB lrw-r--r-- 2024-11-22 17:53:12
Edit Download
3.24 KB lrw-r--r-- 2024-11-22 17:53:12
Edit Download
2.57 KB lrw-r--r-- 2024-11-22 17:53:12
Edit Download
10.14 KB lrw-r--r-- 2024-11-22 17:53:12
Edit Download
2.45 KB lrw-r--r-- 2024-11-22 17:53:12
Edit Download
2.42 KB lrw-r--r-- 2024-11-22 17:53:12
Edit Download
7.77 KB lrw-r--r-- 2024-11-22 17:53:12
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).