- md5
- 18eaccb8a7ad24c4ed900963deeeb2a2
- sha1
- dd16881a945ae6ce3f117430feb752483c55d7d4
- sha256
- c4a081d80ccf7582adc457c09d676b060af2f3a369cad0f63cd8bfbffc0ce572
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
<?php
/**
* Joomla! Content Management System
*
* @copyright Copyright (C) 2005 - 2019 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()
{
$this->setDescription('Removes 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 4 releases, Joomla 4.0.0-alpha7 to 4.0.0-alpha10. See them all, or every version of this file.