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 |
|
---|---|
since |
4.0.0 |
Arguments
- dashboard
string
The name of the dashboard- preset
string
The 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
bool
True 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
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 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
string
The name of the parameter to be retrieved- id
int
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() :
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
string
The type of change (install, update or discover_install, not uninstall)- parent
InstallerAdapter
The class calling this method
Response
bool
True 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
string
The type of change to be made to the param (edit/remove)- id
int
The id of the item in the relevant table
Response
bool
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<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