Back to UpdateCoreCommand class

Method updateJoomlaCore

private bool
updateJoomlaCore
(mixed $updatemodel)
Update Core Joomla
Parameters
  • mixed $updatemodel Update Model
Returns
  • bool success
Since
  • 4.0.0

Method updateJoomlaCore - Source code

/**
 * Update Core Joomla
 *
 * @param   mixed  $updatemodel  Update Model
 *
 * @return  boolean  success
 *
 * @since 4.0.0
 */
private function updateJoomlaCore($updatemodel) : bool
{
    $updateInformation = $this->updateInfo;
    if (!empty($updateInformation['hasUpdate'])) {
        $this->progressBar->advance();
        $this->progressBar->setMessage("Processing update package ...");
        $package = $this->processUpdatePackage($updateInformation);
        $this->progressBar->advance();
        $this->progressBar->setMessage("Finalizing update ...");
        $result = $updatemodel->finaliseUpgrade();
        if ($result) {
            $this->progressBar->advance();
            $this->progressBar->setMessage("Cleaning up ...");
            // Remove the xml
            if (file_exists(JPATH_BASE . '/joomla.xml')) {
                File::delete(JPATH_BASE . '/joomla.xml');
            }
            InstallerHelper::cleanupInstall($package['file'], $package['extractdir']);
            $updatemodel->purge();
            return true;
        }
    }
    return false;
}