ComponentAdapter
Extends InstallerAdapterComponent installer
| since |
3.1 |
|---|---|
| package |
Joomla CMS |
Methods
__construct
Constructor
__construct(\Joomla\CMS\Installer\Installer parent, \Joomla\Database\DatabaseDriver db, mixed||string|int options = []) :
| since |
3.4 |
|---|
Arguments
- parent
InstallerParent object- db
DatabaseDriverDatabase object- options
array<string|int, mixed>Configuration Options
Response
mixed
__get
Proxy for db variable.
__get( name) :
| since |
4.2.0 |
|---|---|
| deprecated |
4.3 will be removed in 6.0 Use getDatabase() instead of directly accessing _db |
Arguments
- name
stringThe name of the element
Response
mixedThe value of the element if set, null otherwise
_buildAdminMenus
Method to build menu database entries for a component
_buildAdminMenus(int|null componentId = null) :
| since |
3.1 |
|---|
Arguments
- componentId
int|nullThe component ID for which I'm building menus
Response
boolTrue if successful
_createAdminMenuItem
Creates the menu item in the database. If the item already exists it tries to remove it and create it afresh.
_createAdminMenuItem(mixed||string|int &data, parentId) : bool|int
| throws |
|
|---|---|
| since |
3.1 |
Arguments
- data
array<string|int, mixed>The menu item data to create- parentId
intThe parent menu item ID
Response
bool|intMenu item ID on success, false on failure
_removeAdminMenus
Method to remove admin menu references to a component
_removeAdminMenus( id) :
| throws |
|
|---|---|
| since |
3.1 |
Arguments
- id
intThe ID of the extension whose admin menus will be removed
Response
boolTrue if successful.
_updateMenus
Method to update menu database entries for a component in case if the component has been uninstalled before.
_updateMenus(int|null componentId, clientId = null) :
| since |
3.7.0 |
|---|
Arguments
- componentId
int|nullThe component ID.- clientId
intThe client id
Response
boolTrue if successful
_updateSiteMenus
Method to update menu database entries for a component in case the component has been uninstalled before.
_updateSiteMenus(int|null componentId = null) :
NOTE: This will not update admin menus. Use _updateMenus() instead to update admin menus ase well.
| since |
3.4.2 |
|---|
Arguments
- componentId
int|nullThe component ID.
Response
boolTrue if successful
canUninstallPackageChild
Check if a package extension allows its child extensions to be uninstalled individually
canUninstallPackageChild( packageId) :
| since |
3.7.0 |
|---|---|
| note |
This method defaults to true to emulate the behavior of 3.6 and earlier which did not support this lookup |
Arguments
- packageId
intThe extension ID of the package to check
Response
bool
checkExistingExtension
Method to check if the extension is already present in the database
checkExistingExtension() :
| since |
3.4 |
|---|---|
| throws |
|
Response
void
checkExtensionInFilesystem
Method to check if the extension is present in the filesystem
checkExtensionInFilesystem() :
| since |
3.4 |
|---|---|
| throws |
|
Response
bool
copyBaseFiles
Method to copy the extension's base files from the <files> tag(s) and the manifest file
copyBaseFiles() :
| since |
3.4 |
|---|---|
| throws |
|
Response
void
createExtensionRoot
Method to create the extension root path if necessary
createExtensionRoot() :
| since |
3.4 |
|---|---|
| throws |
|
Response
void
discover
Discover unregistered extensions.
discover() : mixed||string|int
| since |
3.1 |
|---|
Response
array<string|int, mixed>A list of extensions.
discover_install
Generic discover_install method for extensions
discover_install() :
| since |
3.4 |
|---|
Response
boolTrue on success
doDatabaseTransactions
Method to handle database transactions for the installer
doDatabaseTransactions() :
| since |
3.4 |
|---|---|
| throws |
|
Response
boolTrue on success
doLoadLanguage
Load language files
doLoadLanguage( extension, source, base = JPATH_ADMINISTRATOR) :
| since |
3.4 |
|---|
Arguments
- extension
stringThe name of the extension- source
stringPath to the extension- base
stringBase path for the extension language
Response
void
finaliseInstall
Method to finalise the installation processing
finaliseInstall() :
| since |
3.4 |
|---|---|
| throws |
|
Response
void
finaliseUninstall
Method to finalise the uninstallation processing
finaliseUninstall() :
| since |
4.0.0 |
|---|---|
| throws |
|
Response
bool
getDiscoverInstallSupported
Checks if the adapter supports discover_install
getDiscoverInstallSupported() :
| since |
3.4 |
|---|
Response
bool
getElement
Get the filtered extension element from the manifest
getElement( element = null) :
| since |
3.4 |
|---|
Arguments
- element
stringOptional element name to be converted
Response
stringThe filtered element
getManifest
Get the manifest object.
getManifest() : \SimpleXMLElement
| since |
3.4 |
|---|
Response
SimpleXMLElementManifest object
getName
Get the filtered component name from the manifest
getName() :
| since |
3.4 |
|---|
Response
stringThe filtered name
getParent
Retrieves the parent installer
getParent() : \Joomla\CMS\Installer\Installer
getRoute
Get the install route being followed
getRoute() :
| since |
3.4 |
|---|
Response
stringThe install route
getScriptClassName
Get the class name for the install adapter script.
getScriptClassName() :
| since |
3.4 |
|---|
Response
stringThe class name.
install
Generic install method for extensions
install() : bool|int
| since |
3.4 |
|---|
Response
bool|intThe extension ID on success, boolean false on failure
loadLanguage
Custom loadLanguage method
loadLanguage( path = null) :
| since |
3.1 |
|---|
Arguments
- path
stringThe path language files are on.
Response
void
parseOptionalTags
Method to parse optional tags in the manifest
parseOptionalTags() :
| since |
3.4 |
|---|
Response
void
parseQueries
Method to parse the queries specified in the <sql> tags
parseQueries() :
| since |
4.0.0 |
|---|---|
| throws |
|
Response
void
prepareDiscoverInstall
Prepares the adapter for a discover_install task
prepareDiscoverInstall() :
| since |
3.4 |
|---|---|
| throws |
|
Response
void
refreshManifestCache
Refreshes the extension table cache
refreshManifestCache() :
| since |
3.1 |
|---|
Response
boolResult of operation, true if updated, false on failure
removeExtensionFiles
Removes this extension's files
removeExtensionFiles() :
| since |
4.0.0 |
|---|---|
| throws |
|
Response
void
setManifest
Set the manifest object.
setManifest( manifest) : \Joomla\CMS\Installer\InstallerAdapter
| since |
3.4 |
|---|
Arguments
- manifest
objectThe manifest object
Response
InstallerAdapterInstance of this class to support chaining
setRoute
Set the install route being followed
setRoute( route) : \Joomla\CMS\Installer\InstallerAdapter
| since |
3.4 |
|---|
Arguments
- route
stringThe install route being followed
Response
InstallerAdapterInstance of this class to support chaining
setupInstallPaths
Method to do any prechecks and setup the install paths for the extension
setupInstallPaths() :
| since |
3.4 |
|---|---|
| throws |
|
Response
void
setupScriptfile
Setup the manifest script file for those adapters that use it.
setupScriptfile() :
| since |
3.4 |
|---|
Response
void
setupUninstall
Method to do any prechecks and setup the uninstall job
setupUninstall() :
| since |
4.0.0 |
|---|
Response
void
setupUpdates
Method to setup the update routine for the adapter
setupUpdates() :
| since |
3.4 |
|---|
Response
void
storeExtension
Method to store the extension to the database
storeExtension( deleteExisting = false) :
| since |
3.4 |
|---|---|
| throws |
|
Arguments
- deleteExisting
boolShould I try to delete existing records of the same component?
Response
void
triggerManifestScript
Executes a custom install script method
triggerManifestScript( method) :
| since |
3.4 |
|---|---|
| throws |
|
Arguments
- method
stringThe install method to execute
Response
boolTrue on success
uninstall
Generic update method for extensions
uninstall( id) :
| since |
4.0.0 |
|---|
Arguments
- id
intThe extension ID
Response
boolTrue on success
update
Generic update method for extensions
update() : bool|int
| since |
3.4 |
|---|
Response
bool|intThe extension ID on success, boolean false on failure
Properties
changelogurl
Changelog URL of extensions
| since |
4.0.0 |
|---|
Type(s)
string
currentExtensionId
ID for the currently installed extension if present
| since |
3.4 |
|---|
Type(s)
int
element
The unique identifier for the extension (e.g. mod_login)
| since |
3.4 |
|---|
Type(s)
string
extensionMessage
Messages rendered by custom scripts
| since |
3.4 |
|---|
Type(s)
string
manifest
Copy of the XML manifest file.
Making this object public allows extensions to customize the manifest in custom scripts.
| since |
3.4 |
|---|
Type(s)
SimpleXMLElement
manifest_script
A path to the PHP file that the scriptfile declaration in the manifest refers to.
| since |
3.1 |
|---|
Type(s)
string
name
Name of the extension
| since |
3.4 |
|---|
Type(s)
string
route
Install function routing
| since |
3.4 |
|---|
Type(s)
string
supportsDiscoverInstall
Flag if the adapter supports discover installs
Adapters should override this and set to false if discover install is unsupported
| since |
3.4 |
|---|
Type(s)
bool
type
The type of adapter in use
| since |
3.4 |
|---|
Type(s)
string
oldAdminFiles
The list of current files for the Joomla! CMS administrator that are installed and is read from the manifest on disk in the update area to handle doing a diff and deleting files that are in the old files list and not in the new files list.
| since |
3.1 |
|---|
Type(s)
array<string|int, mixed>
oldApiFiles
The list of current files for the Joomla! CMS API that are installed and is read from the manifest on disk in the update area to handle doing a diff and deleting files that are in the old files list and not in the new files list.
| since |
4.0.0 |
|---|
Type(s)
array<string|int, mixed>
oldFiles
The list of current files that are installed and is read from the manifest on disk in the update area to handle doing a diff and deleting files that are in the old files list and not in the new files list.
| since |
3.1 |
|---|
Type(s)
array<string|int, mixed>
install_script
For legacy installations this is a path to the PHP file that the scriptfile declaration in the manifest refers to.
| since |
3.1 |
|---|
Type(s)
string