- md5
- 40570faf20d4322dcbdccfcac90fc87d
- sha1
- 5934a82fd89d055d5da36c0b36f25e14f88d5244
- sha256
- d1e36c2ed993884fab7fd6ddbc2bb77af292ad927b9b24912fc6ea3cd0bd0f12
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
<?php
/**
* Joomla! Content Management System
*
* @copyright Copyright (C) 2005 - 2020 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\Console\Command\AbstractCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
/**
* Console command for removing files which should have been cleared during an update
*
* @since 4.0.0
*/
class RemoveOldFilesCommand extends AbstractCommand
{
/**
* The default command name
*
* @var string
* @since 4.0.0
*/
protected static $defaultName = 'update:joomla:remove-old-files';
/**
* 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('Removing Old Files');
// We need the update script
\JLoader::register('JoomlaInstallerScript', JPATH_ADMINISTRATOR . '/components/com_admin/script.php');
(new \JoomlaInstallerScript)->deleteUnexistingFiles();
$symfonyStyle->success('Files removed');
return 0;
}
/**
* Configure the command.
*
* @return void
*
* @since 4.0.0
*/
protected function configure(): void
{
$help = "<info>%command.name%</info> removes old files which should have been deleted during a Joomla update
\nUsage: <info>php %command.full_name%</info>";
$this->setDescription('Remove old system files');
$this->setHelp($help);
}
}
The same content is in 3 releases, Joomla 4.0.0-beta3 to 4.0.0-beta5. See them all, or every version of this file.