CoreFiles by mySites.guru
RemoveOldFilesCommand.php65 lines, 1,533 bytes, from Joomla_4.0.0-alpha6-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha5
md5
dbb79482473a9a569e15efeaea605fc9
sha1
0f09408d2dcfb298fdeba0975fa7938a563cd128
sha256
f56a400a37bcb890ee9139f7ae0d415df4a91c8735bb974145ca33e06f297020
<?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.