Installer
class Installer extends JAdapter
Joomla base installer class
Properties
object | $manifestClass | The manifest trigger class | |
Extension | $extension | Extension Table Entry | |
string | $message | The output from the install/uninstall scripts | |
object | $manifest | The installation manifest XML object |
Methods
Constructor
Fetches an adapter and adds it to the internal storage if an instance is not set while also ensuring its a valid adapter name
Set an adapter by name
Loads all adapters.
Returns the global Installer object, only creating it if it doesn't already exist.
Get the allow overwrite switch
Set the allow overwrite switch
Get the redirect location
Set the redirect location
Get whether this installer is uninstalling extensions which are part of a package
Set whether this installer is uninstalling extensions which are part of a package
Get the upgrade switch
Set the upgrade switch
Get the installation manifest object
Get an installer path by name
Sets an installer path by name
Pushes a step onto the installer stack for rolling back steps
Installation abort method
Package installation method
Discovered package installation method
Extension discover method
Package update method
Package uninstallation method
Refreshes the manifest cache stored in #__extensions
Prepare for installation: this method sets the installation directory, finds and checks the installation file and verifies the installation type.
Backward compatible method to parse through a queries element of the installation manifest file and take appropriate action.
Method to extract the name of a discreet installation sql file from the installation manifest file.
Set the schema version for an extension by looking at its latest update
Method to process the updates for an item
Method to parse through a files element of the installation manifest and take appropriate action.
Method to parse through a languages element of the installation manifest and take appropriate action.
Method to parse through a media element of the installation manifest and take appropriate action.
Method to parse the parameters of an extension, build the JSON string for its default parameters, and return the JSON string.
Copyfiles
Method to parse through a files element of the installation manifest and remove the files that were installed
Copies the installation manifest file to the extension folder in the given client
Tries to find the package manifest file
Is the XML file a valid Joomla installation manifest file.
Generates a manifest cache
Cleans up discovered extensions if they're being installed some other way
Compares two "files" entries to find deleted files/folders
Loads an MD5SUMS file into an associative array
Parse a XML install manifest file.
Gets a list of available install adapters.
Method to load an adapter instance
Details
__construct(
string $basepath = __DIR__,
string $classprefix = '\\Joomla\\CMS\\Installer\\Adapter',
string $adapterfolder = 'Adapter')
Constructor
JAdapterInstance|boolean
getAdapter(
string $name,
array $options = array())
Fetches an adapter and adds it to the internal storage if an instance is not set while also ensuring its a valid adapter name
boolean
setAdapter(
string $name,
object $adapter = null,
array $options = array())
Set an adapter by name
static
Installer
getInstance(
string $basepath = __DIR__,
string $classprefix = '\\Joomla\\CMS\\Installer\\Adapter',
string $adapterfolder = 'Adapter')
Returns the global Installer object, only creating it if it doesn't already exist.
boolean
isPackageUninstall()
Get whether this installer is uninstalling extensions which are part of a package
void
setPackageUninstall(
boolean $uninstall)
Set whether this installer is uninstalling extensions which are part of a package
boolean|InstallerAdapter
setupInstall(
string $route = 'install',
boolean $returnAdapter = false)
Prepare for installation: this method sets the installation directory, finds and checks the installation file and verifies the installation type.
mixed
parseQueries(
SimpleXMLElement $element)
Backward compatible method to parse through a queries element of the installation manifest file and take appropriate action.
mixed
parseSQLFiles(
object $element)
Method to extract the name of a discreet installation sql file from the installation manifest file.
void
setSchemaVersion(
SimpleXMLElement $schema,
integer $eid)
Set the schema version for an extension by looking at its latest update
boolean
parseSchemaUpdates(
SimpleXMLElement $schema,
integer $eid)
Method to process the updates for an item
boolean
parseFiles(
SimpleXMLElement $element,
integer $cid,
array $oldFiles = null,
array $oldMD5 = null)
Method to parse through a files element of the installation manifest and take appropriate action.
boolean
parseLanguages(
SimpleXMLElement $element,
integer $cid)
Method to parse through a languages element of the installation manifest and take appropriate action.
boolean
parseMedia(
SimpleXMLElement $element,
integer $cid)
Method to parse through a media element of the installation manifest and take appropriate action.
string
getParams()
Method to parse the parameters of an extension, build the JSON string for its default parameters, and return the JSON string.
boolean
copyFiles(
array $files,
boolean $overwrite = null)
Copyfiles
Copy files from source directory to the target directory
boolean
removeFiles(
object $element,
integer $cid)
Method to parse through a files element of the installation manifest and remove the files that were installed
boolean
copyManifest(
integer $cid = 1)
Copies the installation manifest file to the extension folder in the given client
SimpleXMLElement|null
isManifest(
string $file)
Is the XML file a valid Joomla installation manifest file.
object
cleanDiscoveredExtension(
string $type,
string $element,
string $folder = '',
integer $client)
Cleans up discovered extensions if they're being installed some other way
array
findDeletedFiles(
array $old_files,
array $new_files)
Compares two "files" entries to find deleted files/folders
static
array
parseXMLInstallFile(
string $path)
Parse a XML install manifest file.
XML Root tag should be 'install' except for languages which use meta file.
array
getAdapters(
array $options = array(),
array $custom = array())
Gets a list of available install adapters.
InstallerAdapter
loadAdapter(
string $adapter,
array $options = array())
Method to load an adapter instance