InstallerHelper
Installer helper class
since |
3.1 |
---|
Methods
cleanupInstall
Clean up temporary uploaded package and unpacked extension
cleanupInstall(string $package, string $resultdir) : boolean
since |
3.1 |
---|
Arguments
- $package
string
Path to the uploaded package file- $resultdir
string
Path to the unpacked extension
Response
boolean
True on success
detectType
Method to detect the extension type from a package directory
detectType(string $packageDirectory) : mixed
since |
3.1 |
---|
Arguments
- $packageDirectory
string
Path to package directory
Response
mixed
Extension type string or boolean false on fail
downloadPackage
Downloads a package
downloadPackage(string $url, mixed $target = false) : string|boolean
since |
3.1 |
---|
Arguments
- $url
string
URL of file to download- $target
mixed
Download target filename or false to get the filename from the URL
Response
string|boolean
Path to downloaded package or boolean false on failure
getFilenameFromUrl
Gets a file name out of a url
getFilenameFromUrl(string $url) : string
since |
3.1 |
---|
Arguments
- $url
string
URL to get name from
Response
string
Clean 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(string $packagefile, \Joomla\CMS\Installer\JUpdate $updateObject) : integer
since |
3.9.0 |
---|
Arguments
- $packagefile
string
Location of the package to be installed- $updateObject
\Joomla\CMS\Installer\JUpdate
The Update Object
Response
integer
one if the hashes match, zero if hashes doesn't match, two if hashes not found
splitSql
Splits contents of a sql file into array of discreet queries.
splitSql(string $query) : array
Queries need to be delimited with end of statement marker ';'
since |
3.1 |
---|---|
deprecated |
4.0 Use \JDatabaseDriver::splitSql() directly |
Arguments
- $query
string
The SQL statement.
Response
array
Array of queries
unpack
Unpacks a file and verifies it as a Joomla element package Supports .gz .tar .tar.gz and .zip
unpack(string $packageFilename, boolean $alwaysReturnArray = false) : array|boolean
since |
3.1 |
---|
Arguments
- $packageFilename
string
The uploaded package filename or install directory- $alwaysReturnArray
boolean
If should return false (and leave garbage behind) or return $retval['type']=false
Response
array|boolean
Array on success or boolean false on failure
Constants
HASH_NOT_VALIDATED
Hash not validated identifier.
Value | 0 |
---|---|
since |
3.9.0 |
Type(s)
integer
HASH_VALIDATED
Hash validated identifier.
Value | 1 |
---|---|
since |
3.9.0 |
Type(s)
integer
HASH_NOT_PROVIDED
Hash not provided identifier.
Value | 2 |
---|---|
since |
3.9.0 |
Type(s)
integer