class InstallerScript

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

Methods

boolean
preflight( string $type, InstallerAdapter $parent)

Function called before extension installation/update/removal procedure commences

array
getInstances( boolean $isModule)

Gets each instance of a module in the #__modules table

string
getParam( string $name, integer $id)

Gets parameter value in the extensions row of the extension table

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

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

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

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

void
removeFiles()

Remove the files and folders in the given array from

void
moveCliFiles()

Moves the CLI scripts into the CLI folder in the CMS

Details

boolean preflight( string $type, InstallerAdapter $parent)

Function called before extension installation/update/removal procedure commences

Parameters

string $type The type of change (install, update or discover_install, not uninstall)
InstallerAdapter $parent The class calling this method

Return Value

boolean True on success

array getInstances( boolean $isModule)

Gets each instance of a module in the #__modules table

Parameters

boolean $isModule True if the extension is a module as this can have multiple instances

Return Value

array An array of ID's of the extension

string getParam( string $name, integer $id)

Gets parameter value in the extensions row of the extension table

Parameters

string $name The name of the parameter to be retrieved
integer $id The id of the item in the Param Table

Return Value

string The parameter desired

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

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

Parameters

array $param_array The array of parameters to be added/edited/removed
string $type The type of change to be made to the param (edit/remove)
integer $id The id of the item in the relevant table

Return Value

boolean True on success

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

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

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

Parameters

string $element The element to get from the query
string $table The table to search for the data in
string $column The column of the database to search from
mixed $identifier The integer id or the already quoted string

Return Value

array Associated array containing data from the cell

void removeFiles()

Remove the files and folders in the given array from

Return Value

void

void moveCliFiles()

Moves the CLI scripts into the CLI folder in the CMS

Return Value

void