Abstract Class JInstaller

Description

Joomla base installer class

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

JObject
   |
   --JInstaller
Direct descendents
Class Description
 class JInstallerComponent Component installer
 class JInstallerLanguage Language installer
 class JInstallerModule Module installer
 class JInstallerPlugin Plugin installer
 class JInstallerTemplate Template installer
Variable Summary
Method Summary
 JInstaller __construct (mixed &$db)
 database &getInstance (object &$db, [string $type = null])
 void install ()
 boolean preInstallCheck (string $p_fromdir, string $type)
 void uninstall ()
 void update ()
 boolean _copyFiles (string $p_sourcedir, string $p_destdir, array $p_files, [boolean $overwrite = null])
 boolean _copyInstallFile ([int $client = 1])
 boolean _findInstallFile ()
 string _getParams ()
 mixed _isPackageFile (string $p_file)
 mixed _mapClient (string $client)
 mixed _parseBackwardQueries ([string $tagName = 'queries'])
 mixed _parseFiles ([string $tagName = 'files'], [string $special = null], [string $specialError = null], [boolean $admin = false])
 mixed _parseQueries ([string $tagName = 'install/sql/mysql-412'])
 boolean _readInstallFile ()
 boolean _removeFiles ([string $tagName = 'files'], [boolean $admin = false])
 boolean _rollback ()
Variables
boolean $i_allowOverwrite = false (line 95)

True if existing files can be overwritten

object $i_db = null (line 109)

A database connector object

string $i_description = null (line 124)

The description of the extension

string $i_extensionAdminDir = null (line 81)

The admin directory where the extension is to be installed

string $i_extensionDir = null (line 74)

The site directory where the extension is to be installed

string $i_extensionName = null (line 67)

The name of the Joomla! extension

string $i_extensionSpecial = null (line 88)

The name of a special atttibute in a tag

boolean $i_hasInstallScript = false (line 53)

The does the package have an install script?

string $i_installDir = null (line 32)

The directory that the extension is to be installed from

string $i_installFile = null (line 46)

The xml install file

string $i_installScript = null (line 60)

The package install script

string $i_installType = null (line 39)

The extension type to install

string $i_message = null (line 131)

The output from the install/uninstall scripts

array $i_stepStack = array () (line 117)

Stack of installation steps

  • Used for installation rollback

object $i_xmldoc = null (line 102)

A DOMIT XML document

Methods
Constructor __construct (line 138)

Constructor

  • access: protected
JInstaller __construct (mixed &$db)

Redefinition of:
JObject::__construct()
Class constructor, overridden in descendant classes.
getInstance (line 152)

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

  • return: A database object
  • since: 1.1
  • static:
database &getInstance (object &$db, [string $type = null])
  • object $db: A database connector object
  • string $type: The installer type to instantiate [optional]
install (line 231)

Abstract install method

  • override in child class

  • since: 1.0
  • abstract:
void install ()

Redefined in descendants as:
preInstallCheck (line 189)

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: 1.0
  • access: public
boolean preInstallCheck (string $p_fromdir, string $type)
  • string $p_fromdir: Install from directory
  • string $type: The install type
uninstall (line 253)

Abstract uninstall method

  • override in child class

  • since: 1.0
  • abstract:
void uninstall ()

Redefined in descendants as:
update (line 242)

Abstract update method

  • override in child class

  • since: 1.1
  • abstract:
void update ()
_copyFiles (line 754)

Copy files from source directory to the target directory

  • return: True on success
  • since: 1.0
  • access: private
boolean _copyFiles (string $p_sourcedir, string $p_destdir, array $p_files, [boolean $overwrite = null])
  • string $p_sourcedir: Source directory
  • string $p_destdir: Destination directory
  • array $p_files: array with filenames
  • boolean $overwrite: True if existing files can be replaced
_copyInstallFile (line 821)

Copies the XML install file to the extension folder in the given client

  • return: True on success, False on error
  • since: 1.0
  • access: private
boolean _copyInstallFile ([int $client = 1])
  • int $client: Where to copy the installfile [optional: defaults to 1 (admin)]
_findInstallFile (line 264)

Tries to find the package XML file

  • return: True on success, False on error
  • since: 1.0
boolean _findInstallFile ()
_getParams (line 694)

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

  • return: INI string of parameter values
  • since: 1.1
  • access: private
string _getParams ()
_isPackageFile (line 304)

Is the xml file a valid Joomla install file

  • return: A DOMIT XML document, or null if the file failed to parse
  • since: 1.0
  • access: protected
mixed _isPackageFile (string $p_file)
  • string $p_file: An xmlfile path to check
_mapClient (line 951)

Method to map a client to its base directory. This can be useful moving forward if we want to allow extensions to be installed to applications other than the site and administrator.

  • return: Client application array(id,basePath) or boolean false if not found
  • since: 1.1
  • access: private
mixed _mapClient (string $client)
  • string $client: Client application name
_parseBackwardQueries (line 567)

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

  • return: Number of queries processed or False on error
  • since: 1.1
  • access: private
mixed _parseBackwardQueries ([string $tagName = 'queries'])
  • string $tagName: The tag name to parse
_parseFiles (line 415)

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

  • return: Number of files processed or False on error
  • since: 1.0
  • access: private
mixed _parseFiles ([string $tagName = 'files'], [string $special = null], [string $specialError = null], [boolean $admin = false])
  • string $tagName: The tag name to parse
  • string $special: An attribute to search for in a filename element
  • string $specialError: The value of the 'special' element if found
  • boolean $admin: True for Administrator files
_parseQueries (line 624)

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

  • return: Number of queries processed or False on error
  • since: 1.1
  • access: private
mixed _parseQueries ([string $tagName = 'install/sql/mysql-412'])
  • string $tagName: The tag name to parse
_readInstallFile (line 351)

Loads and parses the XML setup file

  • return: True on success
  • since: 1.0
  • access: private
boolean _readInstallFile ()
_removeFiles (line 841)

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

  • return: True on success
  • since: 1.1
  • access: private
boolean _removeFiles ([string $tagName = 'files'], [boolean $admin = false])
  • string $tagName: The tag name to parse
  • boolean $admin: True for Administrator files
_rollback (line 975)

Roll back the extension installation

  • Called if an installation step fails

  • return: True on success
  • since: 1.1
  • access: private
boolean _rollback ()

Inherited Methods

Inherited From JObject

 JObject::__construct()
 JObject::JObject()
 JObject::get()
 JObject::set()
 JObject::toString()
 JObject::__destruct()

Documentation generated on Sat, 4 Feb 2006 14:24:04 +0100 by phpDocumentor 1.3.0RC4