InstallerHelper

Installer helper class

abstract
since

3.1

package

Joomla CMS

Methods

cleanupInstall

Clean up temporary uploaded package and unpacked extension

cleanupInstall( package,  resultdir) : 
static
since

3.1

Arguments

package

stringPath to the uploaded package file

resultdir

stringPath to the unpacked extension

Response

boolTrue on success

detectType

Method to detect the extension type from a package directory

detectType( packageDirectory) : 
static
since

3.1

Arguments

packageDirectory

stringPath to package directory

Response

mixedExtension type string or boolean false on fail

downloadPackage

Downloads a package

downloadPackage( url, string|bool target = false) : string|bool
static
since

3.1

Arguments

url

stringURL of file to download

target

string|boolDownload target filename or false to get the filename from the URL

Response

string|boolPath to downloaded package or boolean false on failure

getFilenameFromUrl

Gets a file name out of a url

getFilenameFromUrl( url) : 
static
since

3.1

Arguments

url

stringURL to get name from

Response

stringClean version of the filename or a unique id

isChecksumValid

Return the result of the checksum of a package with the SHA256/SHA384/SHA512 tags in the update server manifest

isChecksumValid( packagefile, \Joomla\CMS\Updater\Update updateObject) : 
static
since

3.9.0

Arguments

packagefile

stringLocation of the package to be installed

updateObject

UpdateThe Update Object

Response

intone if the hashes match, zero if hashes doesn't match, two if hashes not found

unpack

Unpacks a file and verifies it as a Joomla element package Supports .gz .tar .tar.gz and .zip

unpack( packageFilename,  alwaysReturnArray = false) : array|bool
static
since

3.1

Arguments

packageFilename

stringThe uploaded package filename or install directory

alwaysReturnArray

boolIf should return false (and leave garbage behind) or return $retval['type']=false

Response

array<string|int, mixed>|boolArray on success or boolean false on failure

Constants

HASH_NOT_VALIDATED

Hash not validated identifier.

Value 0
since

3.9.0

Type(s)

int

HASH_VALIDATED

Hash validated identifier.

Value 1
since

3.9.0

Type(s)

int

HASH_NOT_PROVIDED

Hash not provided identifier.

Value 2
since

3.9.0

Type(s)

int