Class JInstaller

Description

Joomla base installer class

  • since: 11.1

Located in /libraries/joomla/installer/installer.php (line 25)

JObject
   |
   --JAdapter
      |
      --JInstaller
Variable Summary
Method Summary
static object An getInstance ()
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 ()
boolean getOverwrite ()
string getParams ()
string getPath (string $name, [string $default = null])
string getRedirectURL ()
boolean getUpgrade ()
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 111)
  • var: JInstaller instance container.
  • since: 11.3
  • access: protected
JTableExtension $extension = null (line 73)

Extension Table Entry

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

The extension message that appears

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

The installation manifest XML object

  • since: 11.1
  • access: public
object $manifestClass = null (line 49)

The manifest trigger class

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

The output from the install/uninstall scripts

  • since: 11.1
  • access: public
string $redirect_url = null (line 105)

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

  • since: 11.1
  • access: protected
boolean $_overwrite = false (line 56)

True if existing files can be overwritten

  • since: 11.1
  • access: protected
array $_paths = array() (line 33)

Array of paths needed by the installer

  • since: 11.1
  • access: protected
array $_stepStack = array() (line 65)

Stack of installation steps

  • Used for installation rollback

  • since: 11.1
  • access: protected
boolean $_upgrade = null (line 41)

True if package is an upgrade

  • since: 11.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 method getInstance (line 131)

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

  • return: installer object
  • since: 11.1
  • access: public
static object An getInstance ()
static method parseXMLInstallFile (line 2119)

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 118)

Constructor

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

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

Installation abort method

  • return: True if successful
  • since: 11.1
  • 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 1968)

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

  • return: of query
  • since: 11.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 1560)

Copyfiles

Copy files from source directory to the target directory

  • return: True on success
  • since: 11.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 1829)

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

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

Extension discover method Asks each adapter to find extensions

  • return: JExtension
  • since: 11.1
  • access: public
array discover ()
discover_install (line 502)

Discovered package installation method

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

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: 11.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 1857)

Tries to find the package manifest file

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

Generates a manifest cache

  • return: serialised manifest data
  • since: 11.1
  • access: public
string generateManifestCache ()
getManifest (line 275)

Get the installation manifest object

  • return: object
  • since: 11.1
  • access: public
object Manifest getManifest ()
getOverwrite (line 148)

Get the allow overwrite switch

  • return: Allow overwrite switch
  • deprecated: 12.1 Use JInstaller::isOverwrite()
  • since: 11.1
  • access: public
boolean getOverwrite ()
getParams (line 1503)

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: 11.1
  • access: public
string getParams ()
getPath (line 295)

Get an installer path by name

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

Get the redirect location

  • return: Redirect location (or null)
  • since: 11.1
  • access: public
string getRedirectURL ()
getUpgrade (line 225)

Get the upgrade switch

  • deprecated: 12.1 Use JInstaller::isUpgrade()
  • since: 11.1
  • access: public
boolean getUpgrade ()
install (line 434)

Package installation method

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

Is the XML file a valid Joomla installation manifest file.

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

Get the allow overwrite switch

  • return: Allow overwrite switch
  • since: 11.4
  • access: public
boolean isOverwrite ()
isUpgrade (line 238)

Get the upgrade switch

  • since: 11.4
  • access: public
boolean isUpgrade ()
loadMD5Sum (line 2087)

Loads an MD5SUMS file into an associative array

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

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

  • return: True on success
  • since: 11.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 1313)

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

  • return: True on success
  • since: 11.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 1425)

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

  • return: True on success
  • since: 11.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: 11.1
  • access: public
mixed parseQueries (SimpleXMLElement $element)
  • SimpleXMLElement $element: The XML node to process
parseSchemaUpdates (line 1057)

Method to process the updates for an item

  • return: Result of the operations
  • since: 11.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: 11.1
  • access: public
mixed parseSQLFiles (object $element)
  • object $element: The XML node to process
pushStep (line 324)

Pushes a step onto the installer stack for rolling back steps

  • since: 11.1
  • access: public
void pushStep (array $step)
  • array $step: Installer step
refreshManifestCache (line 734)

Refreshes the manifest cache stored in #__extensions

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

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

  • return: True on success
  • since: 11.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 175)

Set the allow overwrite switch

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

Sets an installer path by name

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

Set the redirect location

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

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

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

Set the upgrade switch

  • return: True if upgrade, false otherwise
  • since: 11.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: 11.1
  • access: public
boolean setupInstall ()
uninstall (line 693)

Package uninstallation method

  • return: True if successful
  • since: 11.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 629)

Package update method

  • return: True if successful
  • since: 11.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()
JObject::__toString()

Documentation generated on Mon, 25 Jun 2012 13:55:53 -0500 by phpDocumentor 1.4.4