CoreFiles by mySites.guru
RemoveOldFilesCommand.php68 lines, 1,695 bytes, from Joomla_4.0.0-alpha2-Alpha-Full_Package.zip
Raw History Compare with 3.10.0-alpha9
md5
660f8594bb18b15378a4c9220b311de4
sha1
97cdf084db365f90ea2aec0b345730a35ed61700
sha256
9095770d28b1163de7c556fb7fd5aea4f6848aa1a4b014d43f69d4c2ffdd341b
<?php
/**
 * Joomla! Content Management System
 *
 * @copyright  Copyright (C) 2005 - 2017 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  __DEPLOY_VERSION__
 */
class RemoveOldFilesCommand extends AbstractCommand
{
	/**
	 * Execute the command.
	 *
	 * @return  integer  The exit code for the command.
	 *
	 * @since   __DEPLOY_VERSION__
	 */
	public function execute(): int
	{
		$symfonyStyle = new SymfonyStyle($this->getApplication()->getConsoleInput(), $this->getApplication()->getConsoleOutput());

		$symfonyStyle->title('Removing Old Files');

		// Import the dependencies
		\JLoader::import('joomla.filesystem.file');
		\JLoader::import('joomla.filesystem.folder');

		// 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   __DEPLOY_VERSION__
	 */
	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
		);
	}
}

No other release has this exact content. See every version of this file.