InstallerScript

Base install script for use by extensions providing helper methods for common behaviours.

since

3.6

Methods

getInstances

Gets each instance of a module in the #__modules table

getInstances(boolean $isModule) : array
since

3.6

Arguments

$isModule

booleanTrue if the extension is a module as this can have multiple instances

Response

arrayAn array of ID's of the extension

getItemArray

Builds a standard select query to produce better DRY code in this script.

getItemArray(string $element, string $table, string $column, mixed $identifier) : array

This should produce a single unique cell which is json encoded - it will then return an associated array with this data in.

since

3.6

Arguments

$element

stringThe element to get from the query

$table

stringThe table to search for the data in

$column

stringThe column of the database to search from

$identifier

mixedThe integer id or the already quoted string

Response

arrayAssociated array containing data from the cell

getParam

Gets parameter value in the extensions row of the extension table

getParam(string $name, integer $id) : string
since

3.6

Arguments

$name

stringThe name of the parameter to be retrieved

$id

integerThe id of the item in the Param Table

Response

stringThe parameter desired

moveCliFiles

Moves the CLI scripts into the CLI folder in the CMS

moveCliFiles() : void
since

3.6

preflight

Function called before extension installation/update/removal procedure commences

preflight(string $type, \Joomla\CMS\Installer\InstallerAdapter $parent) : boolean
since

3.6

Arguments

$type

stringThe type of change (install, update or discover_install, not uninstall)

$parent

\Joomla\CMS\Installer\InstallerAdapterThe class calling this method

Response

booleanTrue on success

removeFiles

Remove the files and folders in the given array from

removeFiles() : void
since

3.6

setParams

Sets parameter values in the extensions row of the extension table. Note that the this must be called separately for deleting and editing. Note if edit is called as a type then if the param doesn't exist it will be created

setParams(array $param_array = null, string $type = 'edit', integer $id) : boolean
since

3.6

Arguments

$param_array

arrayThe array of parameters to be added/edited/removed

$type

stringThe type of change to be made to the param (edit/remove)

$id

integerThe id of the item in the relevant table

Response

booleanTrue on success

Properties

release

The version number of the extension.

since

3.6

Type(s)

string

paramTable

The table the parameters are stored in.

since

3.6

Type(s)

string

extension

The extension name. This should be set in the installer script.

since

3.6

Type(s)

string

deleteFiles

A list of files to be deleted

since

3.6

Type(s)

array

deleteFolders

A list of folders to be deleted

since

3.6

Type(s)

array

cliScriptFiles

A list of CLI script files to be copied to the cli directory

since

3.6

Type(s)

array

minimumPhp

Minimum PHP version required to install the extension

since

3.6

Type(s)

string

minimumJoomla

Minimum Joomla! version required to install the extension

since

3.6

Type(s)

string

allowDowngrades

Allow downgrades of your extension

Use at your own risk as if there is a change in functionality people may wish to downgrade.

since

3.6

Type(s)

boolean