class CRM_Extension_Downloader

This class handles downloads of remotely-provided extensions

Properties

CRM_Extension_Container_Basic $container
string $tmpDir

Methods

__construct( $manager, string $containerDir, string $tmpDir)

No description

array
checkRequirements()

Determine whether downloading is supported.

bool
download(string $key, string $downloadUrl)

Install or upgrade an extension from a remote URL.

bool
fetch(string $remoteFile, string $localFile)

Download the remote zipfile.

string|FALSE
extractFiles(string $key, string $zipFile)

Extract an extension from a zip file.

bool
validateFiles($key, $extractedZipPath)

Validate that $extractedZipPath contains valid for extension $key

Details

at line 51
__construct( $manager, string $containerDir, string $tmpDir)

Parameters

$manager
string $containerDir The place to store downloaded & extracted extensions.
string $tmpDir

at line 63
array checkRequirements()

Determine whether downloading is supported.

Return Value

array list of error messages; empty if OK

at line 105
bool download(string $key, string $downloadUrl)

Install or upgrade an extension from a remote URL.

Parameters

string $key The name of the extension being installed.
string $downloadUrl URL of a .zip file.

Return Value

bool TRUE for success

Exceptions

CRM_Extension_Exception

at line 141
bool fetch(string $remoteFile, string $localFile)

Download the remote zipfile.

Parameters

string $remoteFile URL of a .zip file.
string $localFile Path at which to store the .zip file.

Return Value

bool Whether the download was successful.

at line 162
string|FALSE extractFiles(string $key, string $zipFile)

Extract an extension from a zip file.

Parameters

string $key The name of the extension being installed; this usually matches the basedir in the .zip.
string $zipFile The local path to a .zip file.

Return Value

string|FALSE zip file path

at line 202
bool validateFiles($key, $extractedZipPath)

Validate that $extractedZipPath contains valid for extension $key

Parameters

$key
$extractedZipPath

Return Value

bool