Back to ExtensionInstallCommand class

Method processUrlInstallation

public bool
processUrlInstallation
(mixed $url)
Used for installing extension from a URL
Parameters
  • string $url URL to the extension zip file
Returns
  • bool
Since
  • 4.0.0
-
  • \Exception

Method processUrlInstallation - Source code

/**
 * Used for installing extension from a URL
 *
 * @param   string  $url  URL to the extension zip file
 *
 * @return boolean
 *
 * @since 4.0.0
 *
 * @throws \Exception
 */
public function processUrlInstallation($url) : bool
{
    $filename = InstallerHelper::downloadPackage($url);
    $tmpPath = $this->getApplication()->get('tmp_path');
    $path = $tmpPath . '/' . basename($filename);
    $package = InstallerHelper::unpack($path, true);
    if ($package['type'] === false) {
        return false;
    }
    $jInstaller = new Installer();
    $result = $jInstaller->install($package['extractdir']);
    InstallerHelper::cleanupInstall($path, $package['extractdir']);
    return $result;
}