ComponentAdapter
Extends \Joomla\CMS\Installer\InstallerAdapterComponent installer
since |
3.1 |
---|
Methods
__construct
Constructor
__construct(\JAdapter $parent, \JDatabaseDriver $db, array $options = array())
since |
1.6 |
---|
Arguments
- $parent
\JAdapter
Parent object- $db
\JDatabaseDriver
Database object- $options
array
Configuration Options
_buildAdminMenus
Method to build menu database entries for a component
_buildAdminMenus(integer|null $componentId = null) : boolean
since |
3.1 |
---|
Arguments
- $componentId
integer|null
The component ID for which I'm building menus
Response
boolean
True 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(array &$data, integer $parentId) : boolean|integer
Arguments
- $data
array
- $parentId
integer
The parent menu item ID
Response
boolean|integer
Menu item ID on success, false on failure
_removeAdminMenus
Method to remove admin menu references to a component
_removeAdminMenus(integer $id) : boolean
since |
3.1 |
---|
Arguments
- $id
integer
The ID of the extension whose admin menus will be removed
Response
boolean
True if successful.
_updateMenus
Method to update menu database entries for a component in case if the component has been uninstalled before.
_updateMenus(integer|null $componentId, integer $clientId = null) : boolean
since |
3.7.0 |
---|
Arguments
- $componentId
integer|null
The component ID.- $clientId
integer
The client id
Response
boolean
True if successful
_updateSiteMenus
Method to update menu database entries for a component in case the component has been uninstalled before.
_updateSiteMenus(integer|null $componentId = null) : boolean
NOTE: This will not update admin menus. Use _updateMenus() instead to update admin menus ase well.
since |
3.4.2 |
---|
Arguments
- $componentId
integer|null
The component ID.
Response
boolean
True if successful
canUninstallPackageChild
Check if a package extension allows its child extensions to be uninstalled individually
canUninstallPackageChild(integer $packageId) : boolean
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
integer
The extension ID of the package to check
Response
boolean
checkExistingExtension
Method to check if the extension is already present in the database
checkExistingExtension() : void
since |
3.4 |
---|---|
throws |
|
checkExtensionInFilesystem
Method to check if the extension is present in the filesystem, flags the route as update if so
checkExtensionInFilesystem() : void
since |
3.4 |
---|---|
throws |
|
copyBaseFiles
Method to copy the extension's base files from the <files>
tag(s) and the manifest file
copyBaseFiles() : void
since |
3.4 |
---|---|
throws |
|
createExtensionRoot
Method to create the extension root path if necessary
createExtensionRoot() : void
since |
3.4 |
---|---|
throws |
|
discover
Discover unregistered extensions.
discover() : array
since |
3.1 |
---|
Response
array
A list of extensions.
discover_install
Generic discover_install method for extensions
discover_install() : boolean
since |
3.4 |
---|
Response
boolean
True on success
doDatabaseTransactions
Method to handle database transactions for the installer
doDatabaseTransactions() : boolean
since |
3.4 |
---|---|
throws |
|
Response
boolean
True on success
doLoadLanguage
Load language files
doLoadLanguage(string $extension, string $source, string $base = JPATH_ADMINISTRATOR) : void
since |
3.4 |
---|
Arguments
- $extension
string
The name of the extension- $source
string
Path to the extension- $base
string
Base path for the extension language
finaliseInstall
Method to finalise the installation processing
finaliseInstall() : void
since |
3.4 |
---|---|
throws |
|
getDiscoverInstallSupported
Checks if the adapter supports discover_install
getDiscoverInstallSupported() : boolean
since |
3.4 |
---|
Response
boolean
getElement
Get the filtered extension element from the manifest
getElement(string $element = null) : string
since |
3.4 |
---|
Arguments
- $element
string
Optional element name to be converted
Response
string
The filtered element
getManifest
Get the manifest object.
getManifest() : \SimpleXMLElement
since |
3.4 |
---|
Response
\SimpleXMLElement
Manifest object
getName
Get the filtered component name from the manifest
getName() : string
since |
3.4 |
---|
Response
string
The filtered name
getParent
Retrieves the parent object
getParent() : \JAdapter
getParent
Retrieves the parent object
getParent() : \Joomla\CMS\Installer\Installer
Retrieves the parent object.
Response
\Joomla\CMS\Installer\Installer
getRoute
Get the install route being followed
getRoute() : string
since |
3.4 |
---|
Response
string
The install route
getScriptClassName
Get the class name for the install adapter script.
getScriptClassName() : string
since |
3.4 |
---|
Response
string
The class name.
install
Generic install method for extensions
install() : boolean|integer
since |
3.4 |
---|
Response
boolean|integer
The extension ID on success, boolean false on failure
loadLanguage
Custom loadLanguage method
loadLanguage(string $path = null) : void
since |
3.1 |
---|
Arguments
- $path
string
The path language files are on.
parseOptionalTags
Method to parse optional tags in the manifest
parseOptionalTags() : void
since |
3.1 |
---|
parseQueries
Method to parse the queries specified in the <sql>
tags
parseQueries() : void
since |
3.4 |
---|---|
throws |
|
prepareDiscoverInstall
Prepares the adapter for a discover_install task
prepareDiscoverInstall() : void
since |
3.4 |
---|
refreshManifestCache
Refreshes the extension table cache
refreshManifestCache() : boolean
since |
3.1 |
---|
Response
boolean
Result of operation, true if updated, false on failure
setManifest
Set the manifest object.
setManifest(object $manifest) : \Joomla\CMS\Installer\InstallerAdapter
since |
3.4 |
---|
Arguments
- $manifest
object
The manifest object
Response
\Joomla\CMS\Installer\InstallerAdapter
Instance of this class to support chaining
setRoute
Set the install route being followed
setRoute(string $route) : \Joomla\CMS\Installer\InstallerAdapter
since |
3.4 |
---|
Arguments
- $route
string
The install route being followed
Response
\Joomla\CMS\Installer\InstallerAdapter
Instance of this class to support chaining
setupInstallPaths
Method to do any prechecks and setup the install paths for the extension
setupInstallPaths() : void
since |
3.4 |
---|
setupScriptfile
Setup the manifest script file for those adapters that use it.
setupScriptfile() : void
since |
3.4 |
---|
setupUpdates
Method to setup the update routine for the adapter
setupUpdates() : void
since |
3.4 |
---|
storeExtension
Method to store the extension to the database
storeExtension() : void
since |
3.4 |
---|---|
throws |
|
triggerManifestScript
Executes a custom install script method
triggerManifestScript(string $method) : boolean
since |
3.4 |
---|---|
throws |
|
Arguments
- $method
string
The install method to execute
Response
boolean
True on success
uninstall
Custom uninstall method for components
uninstall(integer $id) : boolean
since |
3.1 |
---|
Arguments
- $id
integer
The unique extension id of the component to uninstall
Response
boolean
True on success
update
Generic update method for extensions
update() : boolean|integer
since |
3.4 |
---|
Response
boolean|integer
The extension ID on success, boolean false on failure
Properties
oldAdminFiles
The list of current files fo 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
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
manifest_script
A path to the PHP file that the scriptfile declaration in the manifest refers to.
since |
3.4 |
---|
Type(s)
string
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
currentExtensionId
ID for the currently installed extension if present
since |
3.4 |
---|
Type(s)
integer
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)
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)
boolean
type
The type of adapter in use
since |
3.4 |
---|
Type(s)
string
parent
Parent
Parent object
Type(s)
\Joomla\CMS\Installer\Installer