InstallerScript

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

since

3.6

package

Joomla CMS

Methods

addDashboardMenu

Creates the dashboard menu module

addDashboardMenu( dashboard,  preset) : 
throws

Exception

since

4.0.0

Arguments

dashboard

stringThe name of the dashboard

preset

stringThe name of the menu preset

Response

void

getInstances

Gets each instance of a module in the #__modules table

getInstances( isModule) : mixed||string|int
since

3.6

Arguments

isModule

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

Response

array<string|int, mixed>An array of ID's of the extension

getItemArray

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

getItemArray( element,  table,  column,  identifier) : mixed||string|int

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 string

Response

array<string|int, mixed>Associated array containing data from the cell

getParam

Gets parameter value in the extensions row of the extension table

getParam( name,  id) : 
since

3.6

Arguments

name

stringThe name of the parameter to be retrieved

id

intThe 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() : 
since

3.6

Response

void

preflight

Function called before extension installation/update/removal procedure commences

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

3.6

Arguments

type

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

parent

InstallerAdapterThe class calling this method

Response

boolTrue on success

removeFiles

Remove the files and folders in the given array from

removeFiles() : 
since

3.6

Response

void

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(mixed||string|int paramArray = null,  type = 'edit',  id) : 
since

3.6

Arguments

paramArray

array<string|int, mixed>The array of parameters to be added/edited/removed

type

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

id

intThe id of the item in the relevant table

Response

boolTrue 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<string|int, mixed>

deleteFolders

A list of folders to be deleted

since

3.6

Type(s)

array<string|int, mixed>

cliScriptFiles

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

since

3.6

Type(s)

array<string|int, mixed>

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)

bool