- md5
- e0aafc5bd449e0b11ee3c0e3594133d5
- sha1
- dd85ef5811dc40582f0b86d7004477d5c6e88f55
- sha256
- 4c0c79106be25ef8cdbc6b5990a0cb3de6bc6034302c1f466e3d6dace8acdba6
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
<?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
{
$this->setDescription('Remove old system files');
$this->setHelp(
<<<EOF
The <info>%command.name%</info> command removes old files which should have been deleted during a Joomla update
<info>php %command.full_name%</info>
EOF
);
}
}
The same content is in 2 releases, Joomla 4.0.0-beta to 4.0.0-beta2. See them all, or every version of this file.