Class JInstaller

Description

Joomla base installer class

  • since: 3.1

Located in /libraries/cms/installer/installer.php (line 24)

JObject
   |
   --JAdapter
      |
      --JInstaller
Variable Summary
Method Summary
 static array parseXMLInstallFile (string $path)
 JInstaller __construct ()
 boolean abort ([string $msg = null], [string $type = null])
 object Result cleanDiscoveredExtension (string $type, string $element, [string $folder = ''], [integer $client = 0])
 boolean copyFiles (array $files, [boolean $overwrite = null])
 boolean copyManifest ([integer $cid = 1])
 array discover ()
 boolean discover_install ([integer $eid = null])
 array findDeletedFiles (array $old_files, array $new_files)
 boolean findManifest ()
 object Manifest getManifest ()
 string getParams ()
 string getPath (string $name, [string $default = null])
 string getRedirectURL ()
 boolean install ([string $path = null])
 mixed isManifest (string $file)
 boolean isOverwrite ()
 boolean isUpgrade ()
 array loadMD5Sum (string $filename)
 boolean parseFiles (SimpleXMLElement $element, [integer $cid = 0], [array $oldFiles = null], [array $oldMD5 = null])
 boolean parseLanguages (SimpleXMLElement $element, [integer $cid = 0])
 boolean parseMedia (SimpleXMLElement $element, [integer $cid = 0])
 mixed parseQueries (SimpleXMLElement $element)
 boolean parseSchemaUpdates (SimpleXMLElement $schema, integer $eid)
 mixed parseSQLFiles (object $element)
 void pushStep (array $step)
 mixed refreshManifestCache (integer $eid)
 boolean removeFiles (object $element, [integer $cid = 0])
 boolean setOverwrite ([boolean $state = false])
 void setPath (string $name, string $value)
 void setRedirectURL (string $newurl)
 void setSchemaVersion (SimpleXMLElement $schema, integer $eid)
 boolean setUpgrade ([boolean $state = false])
 boolean setupInstall ()
 boolean uninstall (string $type, mixed $identifier, [integer $cid = 0])
 boolean update ([string $path = null])
Variables
static JInstaller $instance (line 113)

JInstaller instance container.

  • since: 3.1
  • access: protected
JTableExtension $extension = null (line 73)

Extension Table Entry

  • since: 3.1
  • access: public
string $extension_message = null (line 97)

The extension message that appears

  • since: 3.1
  • access: protected
object $manifest = null (line 89)

The installation manifest XML object

  • since: 3.1
  • access: public
object $manifestClass = null (line 48)

The manifest trigger class

  • since: 3.1
  • access: public
string $message = null (line 81)

The output from the install/uninstall scripts

  • since: 3.1
  • access: public
boolean $overwrite = false (line 56)

True if existing files can be overwritten

  • since: 12.1
  • access: protected
array $paths = array() (line 32)

Array of paths needed by the installer

  • since: 3.1
  • access: protected
string $redirect_url = null (line 105)

The redirect URL if this extension (can be null if no redirect)

  • since: 3.1
  • access: protected
array $stepStack = array() (line 65)

Stack of installation steps

  • Used for installation rollback

  • since: 3.1
  • access: protected
boolean $upgrade = null (line 40)

True if package is an upgrade

  • since: 3.1
  • access: protected

Inherited Variables

Inherited from JAdapter

JAdapter::$_adapterfolder
JAdapter::$_adapters
JAdapter::$_basepath
JAdapter::$_classprefix
JAdapter::$_db

Inherited from JObject

JObject::$_errors
Methods
static getInstance (line 136)

Returns the global Installer object, only creating it if it doesn't already exist.

  • return: An installer object
  • since: 3.1
  • access: public
static JInstaller getInstance ()
static parseXMLInstallFile (line 2138)

Parse a XML install manifest file.

XML Root tag should be 'install' except for languages which use meta file.

  • return: XML metadata.
  • since: 12.1
  • access: public
static array parseXMLInstallFile (string $path)
  • string $path: Full path to XML file.
Constructor __construct (line 120)

Constructor

  • since: 3.1
  • access: public
JInstaller __construct ()

Redefinition of:
JAdapter::__construct()
Constructor
abort (line 318)

Installation abort method

  • return: True if successful
  • since: 3.1
  • throws: RuntimeException
  • access: public
boolean abort ([string $msg = null], [string $type = null])
  • string $msg: Abort message from the installer
  • string $type: Package type if defined
cleanDiscoveredExtension (line 1971)

Cleans up discovered extensions if they're being installed some other way

  • return: of query
  • since: 3.1
  • access: public
object Result cleanDiscoveredExtension (string $type, string $element, [string $folder = ''], [integer $client = 0])
  • 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)
  • integer $client: The client application (administrator or site)
copyFiles (line 1559)

Copyfiles

Copy files from source directory to the target directory

  • return: True on success
  • since: 3.1
  • access: public
boolean copyFiles (array $files, [boolean $overwrite = null])
  • array $files: Array with filenames
  • boolean $overwrite: True if existing files can be replaced
copyManifest (line 1830)

Copies the installation manifest file to the extension folder in the given client

  • return: True on success, False on error
  • since: 3.1
  • access: public
boolean copyManifest ([integer $cid = 1])
  • integer $cid: Where to copy the installfile [optional: defaults to 1 (admin)]
discover (line 585)

Extension discover method Asks each adapter to find extensions

  • return: JExtension
  • since: 3.1
  • access: public
array discover ()
discover_install (line 486)

Discovered package installation method

  • return: True if successful
  • since: 3.1
  • access: public
boolean discover_install ([integer $eid = null])
  • integer $eid: Extension ID
findDeletedFiles (line 1996)

Compares two "files" entries to find deleted files/folders

  • return: An array with the delete files and folders in findDeletedFiles[files] and findDeletedFiles[folders] respectively
  • since: 3.1
  • access: public
array findDeletedFiles (array $old_files, array $new_files)
  • array $old_files: An array of SimpleXMLElement objects that are the old files
  • array $new_files: An array of SimpleXMLElement objects that are the new files
findManifest (line 1858)

Tries to find the package manifest file

  • return: True on success, False on error
  • since: 3.1
  • access: public
boolean findManifest ()
generateManifestCache (line 1954)

Generates a manifest cache

  • return: serialised manifest data
  • since: 3.1
  • access: public
string generateManifestCache ()
getManifest (line 253)

Get the installation manifest object

  • return: object
  • since: 3.1
  • access: public
object Manifest getManifest ()
getParams (line 1502)

Method to parse the parameters of an extension, build the INI string for its default parameters, and return the INI string.

  • return: INI string of parameter values
  • since: 3.1
  • access: public
string getParams ()
getPath (line 273)

Get an installer path by name

  • return: Path
  • since: 3.1
  • access: public
string getPath (string $name, [string $default = null])
  • string $name: Path name
  • string $default: Default value
getRedirectURL (line 190)

Get the redirect location

  • return: Redirect location (or null)
  • since: 3.1
  • access: public
string getRedirectURL ()
install (line 414)

Package installation method

  • return: True if successful
  • since: 3.1
  • access: public
boolean install ([string $path = null])
  • string $path: Path to package source folder
isManifest (line 1927)

Is the XML file a valid Joomla installation manifest file.

  • return: A SimpleXMLElement, or null if the file failed to parse
  • since: 3.1
  • access: public
mixed isManifest (string $file)
  • string $file: An xmlfile path to check
isOverwrite (line 153)

Get the allow overwrite switch

  • return: Allow overwrite switch
  • since: 3.1
  • access: public
boolean isOverwrite ()
isUpgrade (line 216)

Get the upgrade switch

  • since: 3.1
  • access: public
boolean isUpgrade ()
loadMD5Sum (line 2101)

Loads an MD5SUMS file into an associative array

  • return: Associative array with filenames as the index and the MD5 as the value
  • since: 3.1
  • access: public
array loadMD5Sum (string $filename)
  • string $filename: Filename to load
parseFiles (line 1182)

Method to parse through a files element of the installation manifest and take appropriate action.

  • return: True on success
  • since: 3.1
  • access: public
boolean parseFiles (SimpleXMLElement $element, [integer $cid = 0], [array $oldFiles = null], [array $oldMD5 = null])
  • SimpleXMLElement $element: The XML node to process
  • integer $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)
parseLanguages (line 1308)

Method to parse through a languages element of the installation manifest and take appropriate action.

  • return: True on success
  • since: 3.1
  • access: public
boolean parseLanguages (SimpleXMLElement $element, [integer $cid = 0])
  • SimpleXMLElement $element: The XML node to process
  • integer $cid: Application ID of application to install to
parseMedia (line 1424)

Method to parse through a media element of the installation manifest and take appropriate action.

  • return: True on success
  • since: 3.1
  • access: public
boolean parseMedia (SimpleXMLElement $element, [integer $cid = 0])
  • SimpleXMLElement $element: The XML node to process
  • integer $cid: Application ID of application to install to
parseQueries (line 837)

Backward compatible method to parse through a queries element of the installation manifest file and take appropriate action.

  • return: Number of queries processed or False on error
  • since: 3.1
  • access: public
mixed parseQueries (SimpleXMLElement $element)
  • SimpleXMLElement $element: The XML node to process
parseSchemaUpdates (line 1043)

Method to process the updates for an item

  • return: Result of the operations
  • since: 3.1
  • access: public
boolean parseSchemaUpdates (SimpleXMLElement $schema, integer $eid)
  • SimpleXMLElement $schema: The XML node to process
  • integer $eid: Extension Identifier
parseSQLFiles (line 882)

Method to extract the name of a discreet installation sql file from the installation manifest file.

  • return: Number of queries processed or False on error
  • since: 3.1
  • access: public
mixed parseSQLFiles (object $element)
  • object $element: The XML node to process
pushStep (line 302)

Pushes a step onto the installer stack for rolling back steps

  • since: 3.1
  • access: public
void pushStep (array $step)
  • array $step: Installer step
refreshManifestCache (line 732)

Refreshes the manifest cache stored in #__extensions

  • return: void on success, false on error @todo missing return value ?
  • since: 3.1
  • access: public
mixed refreshManifestCache (integer $eid)
  • integer $eid: Extension ID
removeFiles (line 1674)

Method to parse through a files element of the installation manifest and remove the files that were installed

  • return: True on success
  • since: 3.1
  • access: public
boolean removeFiles (object $element, [integer $cid = 0])
  • object $element: The XML node to process
  • integer $cid: Application ID of application to remove from
setOverwrite (line 167)

Set the allow overwrite switch

  • return: True it state is set, false if it is not
  • since: 3.1
  • access: public
boolean setOverwrite ([boolean $state = false])
  • boolean $state: Overwrite switch state
setPath (line 288)

Sets an installer path by name

  • since: 3.1
  • access: public
void setPath (string $name, string $value)
  • string $name: Path name
  • string $value: Path
setRedirectURL (line 204)

Set the redirect location

  • since: 3.1
  • access: public
void setRedirectURL (string $newurl)
  • string $newurl: New redirect location
setSchemaVersion (line 974)

Set the schema version for an extension by looking at its latest update

  • since: 3.1
  • access: public
void setSchemaVersion (SimpleXMLElement $schema, integer $eid)
  • SimpleXMLElement $schema: Schema Tag
  • integer $eid: Extension ID
setUpgrade (line 230)

Set the upgrade switch

  • return: True if upgrade, false otherwise
  • since: 3.1
  • access: public
boolean setUpgrade ([boolean $state = false])
  • boolean $state: Upgrade switch state
setupInstall (line 804)

Prepare for installation: this method sets the installation directory, finds and checks the installation file and verifies the installation type.

  • return: True on success
  • since: 3.1
  • access: public
boolean setupInstall ()
uninstall (line 686)

Package uninstallation method

  • return: True if successful
  • since: 3.1
  • access: public
boolean uninstall (string $type, mixed $identifier, [integer $cid = 0])
  • string $type: Package type
  • mixed $identifier: Package identifier for adapter
  • integer $cid: Application ID; deprecated in 1.6
update (line 618)

Package update method

  • return: True if successful
  • since: 3.1
  • access: public
boolean update ([string $path = null])
  • string $path: Path to package source folder

Inherited Methods

Inherited From JAdapter

 JAdapter::__construct()
 JAdapter::getAdapter()
 JAdapter::getDBO()
 JAdapter::loadAllAdapters()
 JAdapter::setAdapter()

Inherited From JObject

 JObject::__construct()
 JObject::def()
 JObject::get()
 JObject::getError()
 JObject::getErrors()
 JObject::getProperties()
 JObject::set()
 JObject::setError()
 JObject::setProperties()
 JObject::__toString()

Documentation generated on Tue, 19 Nov 2013 15:05:47 +0100 by phpDocumentor 1.4.3