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
boolean
True if the extension is a module as this can have multiple instances
Response
array
An 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
string
The element to get from the query- $table
string
The table to search for the data in- $column
string
The column of the database to search from- $identifier
mixed
The integer id or the already quoted string
Response
array
Associated 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
string
The name of the parameter to be retrieved- $id
integer
The id of the item in the Param Table
Response
string
The 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
string
The type of change (install, update or discover_install, not uninstall)- $parent
\Joomla\CMS\Installer\InstallerAdapter
The class calling this method
Response
boolean
True 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 $paramArray = null, string $type = 'edit', integer $id) : boolean
since |
3.6 |
---|
Arguments
- $paramArray
array
The array of parameters to be added/edited/removed- $type
string
The type of change to be made to the param (edit/remove)- $id
integer
The id of the item in the relevant table
Response
boolean
True 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