CoreFiles by mySites.guru
CleanupModel.php43 lines, 1,198 bytes, from Joomla_4.2.1-rc2-Release_Candidate-Full_Package.zip
Raw History Compare with 4.2.1-rc1
md5
403236e9cc4cbfec5ea57da6d8c0ae91
sha1
f0158bc884d44ec95404222169df1e3b40ed4d4a
sha256
b1dea137125ad0cf8363d76513534a63892f56b22a1e5c49deb63588359e78f4
<?php

/**
 * @package     Joomla.Installation
 * @subpackage  Model
 *
 * @copyright   (C) 2017 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\CMS\Installation\Model;

use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Filesystem\Folder;

/**
 * Cleanup model for the Joomla Core Installer.
 *
 * @since  4.0.0
 */
class CleanupModel extends BaseInstallationModel
{
    /**
     * Deletes the installation folder. Returns true on success.
     *
     * @return  boolean
     *
     * @since   4.0.0
     */
    public function deleteInstallationFolder()
    {
        $return = Folder::delete(JPATH_INSTALLATION) && (!file_exists(JPATH_ROOT . '/joomla.xml') || File::delete(JPATH_ROOT . '/joomla.xml'));

        // Rename the robots.txt.dist file if robots.txt doesn't exist
        if ($return && !file_exists(JPATH_ROOT . '/robots.txt') && file_exists(JPATH_ROOT . '/robots.txt.dist')) {
            $return = File::move(JPATH_ROOT . '/robots.txt.dist', JPATH_ROOT . '/robots.txt');
        }

        \clearstatcache(true, JPATH_INSTALLATION . '/index.php');

        return $return;
    }
}

The same content is in 5 releases, Joomla 4.2.0-beta3 to 4.2.1-rc2. See them all, or every version of this file.