- md5
- dbb79482473a9a569e15efeaea605fc9
- sha1
- 0f09408d2dcfb298fdeba0975fa7938a563cd128
- sha256
- f56a400a37bcb890ee9139f7ae0d415df4a91c8735bb974145ca33e06f297020
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
<?php
/**
* Joomla! Content Management System
*
* @copyright Copyright (C) 2005 - 2018 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\AbstractCommand;
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
{
/**
* Execute the command.
*
* @return integer The exit code for the command.
*
* @since 4.0.0
*/
public function execute(): int
{
$symfonyStyle = new SymfonyStyle($this->getApplication()->getConsoleInput(), $this->getApplication()->getConsoleOutput());
$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;
}
/**
* Initialise the command.
*
* @return void
*
* @since 4.0.0
*/
protected function initialise()
{
$this->setName('update:joomla:remove-old-files');
$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 2 releases, Joomla 4.0.0-alpha5 to 4.0.0-alpha6. See them all, or every version of this file.