Back to UpdateCoreCommand class

Method processUpdatePackage

public array
processUpdatePackage
(mixed $updateInformation)
Downloads and extracts the update Package
Parameters
  • array $updateInformation Stores the update information
Returns
  • array | boolean
Since
  • 4.0.0

Method processUpdatePackage - Source code

/**
 * Downloads and extracts the update Package
 *
 * @param   array  $updateInformation  Stores the update information
 *
 * @return array | boolean
 *
 * @since 4.0.0
 */
public function processUpdatePackage($updateInformation)
{
    if (!$updateInformation['object']) {
        return false;
    }
    $this->progressBar->advance();
    $this->progressBar->setMessage("Downloading update package ...");
    $file = $this->downloadFile($updateInformation['object']->downloadurl->_data);
    $tmpPath = $this->getApplication()->get('tmp_path');
    $updatePackage = $tmpPath . '/' . $file;
    $this->progressBar->advance();
    $this->progressBar->setMessage("Extracting update package ...");
    $package = $this->extractFile($updatePackage);
    $this->progressBar->advance();
    $this->progressBar->setMessage("Copying files ...");
    $this->copyFileTo($package['extractdir'], JPATH_BASE);
    return ['file' => $updatePackage, 'extractdir' => $package['extractdir']];
}