Back to Joomla project (class list)

Class Installer - list of methods

Joomla base installer class

Extends

Package: Joomla\CMS\Installer
Copyright: (C) 2005 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE.txt
Located at: Joomla/Installer/Installer.php
Project: Joomla

Method Summary

public
(mixed $basepath = __DIR__, mixed $classprefix = '\\Joomla\\CMS\\Installer\\Adapter', mixed $adapterfolder = 'Adapter')

Constructor
Parameters
  • string $basepath Base Path of the adapters
  • string $classprefix Class prefix of adapters
  • string $adapterfolder Name of folder to append to base path
Since
  • 3.1
Show source code of this method: __construct Source Code

public static \Joomla\CMS\Installer\Installer
(mixed $basepath = __DIR__, mixed $classprefix = '\\Joomla\\CMS\\Installer\\Adapter', mixed $adapterfolder = 'Adapter')

Returns the global Installer object, only creating it if it doesn't already exist.
Parameters
  • string $basepath Base Path of the adapters
  • string $classprefix Class prefix of adapters
  • string $adapterfolder Name of folder to append to base path
Returns
  • \Joomla\CMS\Installer\Installer An installer object
Since
  • 3.1
Show source code of this method: getInstance Source Code

public bool
()

Get the allow overwrite switch
Returns
  • bool Allow overwrite switch
Since
  • 3.1
Show source code of this method: isOverwrite Source Code

public bool
(mixed $state = false)

Set the allow overwrite switch
Parameters
  • bool $state Overwrite switch state
Returns
  • bool True it state is set, false if it is not
Since
  • 3.1
Show source code of this method: setOverwrite Source Code

public string
()

Get the redirect location
Returns
  • string Redirect location (or null)
Since
  • 3.1
Show source code of this method: getRedirectUrl Source Code

public void
(mixed $newurl)

Set the redirect location
Parameters
  • string $newurl New redirect location
Returns
  • void
Since
  • 3.1
Show source code of this method: setRedirectUrl Source Code

public bool
()

Get whether this installer is uninstalling extensions which are part of a package
Returns
  • bool
Since
  • 3.7.0
Show source code of this method: isPackageUninstall Source Code

public void
(mixed $uninstall)

Set whether this installer is uninstalling extensions which are part of a package
Parameters
  • bool $uninstall True if a package triggered the uninstall, false otherwise
Returns
  • void
Since
  • 3.7.0
Show source code of this method: setPackageUninstall Source Code

public bool
()

Get the upgrade switch
Returns
  • bool
Since
  • 3.1
Show source code of this method: isUpgrade Source Code

public bool
(mixed $state = false)

Set the upgrade switch
Parameters
  • bool $state Upgrade switch state
Returns
  • bool True if upgrade, false otherwise
Since
  • 3.1
Show source code of this method: setUpgrade Source Code

public \SimpleXMLElement
()

Get the installation manifest object
Returns
  • \SimpleXMLElement Manifest object
Since
  • 3.1
Show source code of this method: getManifest Source Code

public string
(mixed $name, mixed $default = null)

Get an installer path by name
Parameters
  • string $name Path name
  • string $default Default value
Returns
  • string Path
Since
  • 3.1
Show source code of this method: getPath Source Code

public void
(mixed $name, mixed $value)

Sets an installer path by name
Parameters
  • string $name Path name
  • string $value Path
Returns
  • void
Since
  • 3.1
Show source code of this method: setPath Source Code

public void
(mixed $step)

Pushes a step onto the installer stack for rolling back steps
Parameters
  • array $step Installer step
Returns
  • void
Since
  • 3.1
Show source code of this method: pushStep Source Code

public bool
(mixed $msg = null, mixed $type = null)

Installation abort method
Parameters
  • string $msg Abort message from the installer
  • string $type Package type if defined
Returns
  • bool True if successful
Since
  • 3.1
Show source code of this method: abort Source Code

public bool
(mixed $path = null)

Package installation method
Parameters
  • string $path Path to package source folder
Returns
  • bool True if successful
Since
  • 3.1
Show source code of this method: install Source Code

public bool
(mixed $eid = null)

Discovered package installation method
Parameters
  • int $eid Extension ID
Returns
  • bool True if successful
Since
  • 3.1
Show source code of this method: discover_install Source Code

public \Joomla\CMS\Installer\InstallerExtension[]
()

Extension discover method
Returns
  • \Joomla\CMS\Installer\InstallerExtension[]
Since
  • 3.1
Show source code of this method: discover Source Code

public bool
(mixed $path = null)

Package update method
Parameters
  • string $path Path to package source folder
Returns
  • bool True if successful
Since
  • 3.1
Show source code of this method: update Source Code

public bool
(mixed $type, mixed $identifier)

Package uninstallation method
Parameters
  • string $type Package type
  • mixed $identifier Package identifier for adapter
Returns
  • bool True if successful
Since
  • 3.1
Show source code of this method: uninstall Source Code

public bool
(mixed $eid)

Refreshes the manifest cache stored in #__extensions
Parameters
  • int $eid Extension ID
Returns
  • bool
Since
  • 3.1
Show source code of this method: refreshManifestCache Source Code

public bool|\Joomla\CMS\Installer\InstallerAdapter
(mixed $route = 'install', mixed $returnAdapter = false)

Prepare for installation: this method sets the installation directory, finds and checks the installation file and verifies the installation type.
Parameters
  • string $route The install route being followed
  • bool $returnAdapter Flag to return the instantiated adapter
Returns
  • bool|\Joomla\CMS\Installer\InstallerAdapter InstallerAdapter object if explicitly requested otherwise boolean
Since
  • 3.1
Show source code of this method: setupInstall Source Code

public mixed
(\SimpleXMLElement $element)

Backward compatible method to parse through a queries element of the installation manifest file and take appropriate action.
Parameters
  • \SimpleXMLElement $element The XML node to process
Returns
  • mixed Number of queries processed or False on error
Since
  • 3.1
Show source code of this method: parseQueries Source Code

public mixed
(mixed $element)

Method to extract the name of a discreet installation sql file from the installation manifest file.
Parameters
  • object $element The XML node to process
Returns
  • mixed Number of queries processed or False on error
Since
  • 3.1
Show source code of this method: parseSQLFiles Source Code

public void
(\SimpleXMLElement $schema, mixed $eid)

Set the schema version for an extension by looking at its latest update
Parameters
  • \SimpleXMLElement $schema Schema Tag
  • int $eid Extension ID
Returns
  • void
Since
  • 3.1
Show source code of this method: setSchemaVersion Source Code

public bool
(\SimpleXMLElement $schema, mixed $eid)

Method to process the updates for an item
Parameters
  • \SimpleXMLElement $schema The XML node to process
  • int $eid Extension Identifier
Returns
  • bool Result of the operations
Since
  • 3.1
Show source code of this method: parseSchemaUpdates Source Code

public bool
(\SimpleXMLElement $element, mixed $cid = 0, mixed $oldFiles = null, mixed $oldMD5 = null)

Method to parse through a files element of the installation manifest and take appropriate action.
Parameters
  • \SimpleXMLElement $element The XML node to process
  • int $cid Application ID of application to install to
  • array $oldFiles List of old files (SimpleXMLElement's)
  • array $oldMD5 List of old MD5 sums (indexed by filename with value as MD5)
Returns
  • bool True on success
Since
  • 3.1
Show source code of this method: parseFiles Source Code

public bool
(\SimpleXMLElement $element, mixed $cid = 0)

Method to parse through a languages element of the installation manifest and take appropriate action.
Parameters
  • \SimpleXMLElement $element The XML node to process
  • int $cid Application ID of application to install to
Returns
  • bool True on success
Since
  • 3.1
Show source code of this method: parseLanguages Source Code

public bool
(\SimpleXMLElement $element, mixed $cid = 0)

Method to parse through a media element of the installation manifest and take appropriate action.
Parameters
  • \SimpleXMLElement $element The XML node to process
  • int $cid Application ID of application to install to
Returns
  • bool True on success
Since
  • 3.1
Show source code of this method: parseMedia Source Code

public string
()

Method to parse the parameters of an extension, build the JSON string for its default parameters, and return the JSON string.
Returns
  • string JSON string of parameter values
Since
  • 3.1
-
  • This method must always return a JSON compliant string
Show source code of this method: getParams Source Code

public bool
(mixed $files, mixed $overwrite = null)

Copyfiles
Parameters
  • array $files Array with filenames
  • bool $overwrite True if existing files can be replaced
Returns
  • bool True on success
Since
  • 3.1
Show source code of this method: copyFiles Source Code

public bool
(mixed $element, mixed $cid = 0)

Method to parse through a files element of the installation manifest and remove the files that were installed
Parameters
  • object $element The XML node to process
  • int $cid Application ID of application to remove from
Returns
  • bool True on success
Since
  • 3.1
Show source code of this method: removeFiles Source Code

public bool
(mixed $cid = 1)

Copies the installation manifest file to the extension folder in the given client
Parameters
  • int $cid Where to copy the installfile [optional: defaults to 1 (admin)]
Returns
  • bool True on success, False on error
Since
  • 3.1
Show source code of this method: copyManifest Source Code

public bool
()

Tries to find the package manifest file
Returns
  • bool True on success, False on error
Since
  • 3.1
Show source code of this method: findManifest Source Code

public \SimpleXMLElement|null
(mixed $file)

Is the XML file a valid Joomla installation manifest file.
Parameters
  • string $file An xmlfile path to check
Returns
  • \SimpleXMLElement|null A \SimpleXMLElement, or null if the file failed to parse
Since
  • 3.1
Show source code of this method: isManifest Source Code

public string
()

Generates a manifest cache
Returns
  • string serialised manifest data
Since
  • 3.1
Show source code of this method: generateManifestCache Source Code

public object
(mixed $type, mixed $element, mixed $folder = '', mixed $client = 0)

Cleans up discovered extensions if they're being installed some other way
Parameters
  • string $type The type of extension (component, etc)
  • string $element Unique element identifier (e.g. com_content)
  • string $folder The folder of the extension (plugins; e.g. system)
  • int $client The client application (administrator or site)
Returns
  • object Result of query
Since
  • 3.1
Show source code of this method: cleanDiscoveredExtension Source Code

public array
(mixed $oldFiles, mixed $newFiles)

Compares two "files" entries to find deleted files/folders
Parameters
  • array $oldFiles An array of \SimpleXMLElement objects that are the old files
  • array $newFiles An array of \SimpleXMLElement objects that are the new files
Returns
  • array An array with the delete files and folders in findDeletedFiles[files] and findDeletedFiles[folders] respectively
Since
  • 3.1
Show source code of this method: findDeletedFiles Source Code

public array
(mixed $filename)

Loads an MD5SUMS file into an associative array
Parameters
  • string $filename Filename to load
Returns
  • array Associative array with filenames as the index and the MD5 as the value
Since
  • 3.1
Show source code of this method: loadMD5Sum Source Code

public static array
(mixed $path)

Parse a XML install manifest file.
Parameters
  • string $path Full path to XML file.
Returns
  • array XML metadata.
Since
  • 3.0.0
Show source code of this method: parseXMLInstallFile Source Code

public string[]
(mixed $options = array(), array $custom = array())

Gets a list of available install adapters.
Parameters
  • array $options An array of options to inject into the adapter
  • array $custom Array of custom install adapters
Returns
  • string[] An array of the class names of available install adapters.
Since
  • 3.4
Show source code of this method: getAdapters Source Code

public \Joomla\CMS\Installer\InstallerAdapter
(mixed $adapter, mixed $options = array())

Method to load an adapter instance
Parameters
  • string $adapter Adapter name
  • array $options Adapter options
Returns
  • \Joomla\CMS\Installer\InstallerAdapter
Since
  • 3.4
-
  • \InvalidArgumentException
Show source code of this method: loadAdapter Source Code

Properties Summary

protected array
$paths
Array of paths needed by the installer
Since
  • 3.1
protected bool
$upgrade
True if package is an upgrade
Since
  • 3.1
public object
$manifestClass
The manifest trigger class
Since
  • 3.1
protected bool
$overwrite
True if existing files can be overwritten
Since
  • 3.0.0
protected array
$stepStack
Stack of installation steps - Used for installation rollback
Since
  • 3.1
public \Joomla\CMS\Table\Extension
$extension
Extension Table Entry
Since
  • 3.1
public string
$message
The output from the install/uninstall scripts
Since
  • 3.1
public object
$manifest
The installation manifest XML object
Since
  • 3.1
protected string
$extension_message
The extension message that appears
Since
  • 3.1
protected string
$redirect_url
The redirect URL if this extension (can be null if no redirect)
Since
  • 3.1
protected bool
$packageUninstall
Flag if the uninstall process was triggered by uninstalling a package
Since
  • 3.7.0
public string
$extraQuery
Backup extra_query during update_sites rebuild
Since
  • 3.9.26
protected static \Joomla\CMS\Installer\Installer[]
$instances
JInstaller instances container.
Since
  • 3.4

Tags Summary

Since
3.1