Installer Class Reference
[Install]

Base class for install and upgrade scripts. More...

Inheritance diagram for Installer:

Install Upgrade

List of all members.

Public Member Functions

 addInstallAction (&$node)
 destroy ()
 execute ()
 executeAction ($action)
 executeInstaller ()
 getConfigContents ()
getCurrentVersion ()
 getErrorMsg ()
 getErrorString ()
 getErrorType ()
getNewVersion ()
 getNotes ()
 getParam ($name)
 getSQL ()
 Installer ($descriptor, $params=array())
 isUpgrade ()
 parseInstaller ()
 parseInstallNodes (&$installTree)
 postInstall ()
 preInstall ()
 setError ($type, $msg)
 updateConfig ($configParams)
 updateVersion ()
 wroteConfig ()


Detailed Description

Base class for install and upgrade scripts.

Definition at line 36 of file Installer.inc.php.


Member Function Documentation

Installer.addInstallAction ( &$  node  ) 

Add an installer action from the descriptor.

Parameters:
$node XMLNode

Definition at line 331 of file Installer.inc.php.

Referenced by parseInstallNodes().

Installer.destroy (  ) 

Destroy / clean-up after the installer.

Definition at line 119 of file Installer.inc.php.

References HookRegistry.call().

Installer.execute (  ) 

Installation.

Returns:
boolean

Definition at line 172 of file Installer.inc.php.

References executeInstaller(), parseInstaller(), postInstall(), preInstall(), and updateVersion().

Installer.executeAction ( action  ) 

Execute a single installer action.

Parameters:
$action array
Returns:
boolean

Definition at line 365 of file Installer.inc.php.

References setError(), and Locale.translate().

Referenced by executeInstaller().

Installer.executeInstaller (  ) 

Execute the installer actions.

Returns:
boolean

Definition at line 261 of file Installer.inc.php.

References HookRegistry.call(), and executeAction().

Referenced by execute().

Installer.getConfigContents (  ) 

Get the contents of the updated configuration file.

Returns:
string

Definition at line 515 of file Installer.inc.php.

& Installer.getCurrentVersion (  ) 

Return currently installed version.

Returns:
Version

Definition at line 483 of file Installer.inc.php.

Installer.getErrorMsg (  ) 

The error message, if an error has occurred. In the case of a database error, an unlocalized string containing the error message is returned. For any other error, a localization key for the error message is returned.

Returns:
string

Definition at line 545 of file Installer.inc.php.

Referenced by getErrorString().

Installer.getErrorString (  ) 

Return the error message as a localized string.

Returns:
string.

Definition at line 553 of file Installer.inc.php.

References getErrorMsg(), getErrorType(), and Locale.translate().

Installer.getErrorType (  ) 

Return the error code. Valid return values are:

  • 0 = no error
  • INSTALLER_ERROR_GENERAL = general installation error.
  • INSTALLER_ERROR_DB = database installation error
    Returns:
    int

Definition at line 535 of file Installer.inc.php.

Referenced by getErrorString(), and parseInstaller().

& Installer.getNewVersion (  ) 

Return new version after installation.

Returns:
Version

Definition at line 491 of file Installer.inc.php.

Installer.getNotes (  ) 

Get the set of installation notes.

Returns:
array

Definition at line 507 of file Installer.inc.php.

Installer.getParam ( name  ) 

Get the value of an installation parameter.

Parameters:
$name 
Returns:
mixed

Definition at line 475 of file Installer.inc.php.

Referenced by Install.createConfig(), Install.createData(), Install.createDatabase(), Install.createDirectories(), Install.preInstall(), and updateVersion().

Installer.getSQL (  ) 

Get the set of SQL statements required to perform the install.

Returns:
array

Definition at line 499 of file Installer.inc.php.

Installer.Installer ( descriptor,
params = array() 
)

Constructor.

Parameters:
$descriptor string descriptor path
$params array installer parameters

Definition at line 92 of file Installer.inc.php.

References HookRegistry.call(), PluginRegistry.loadAllPlugins(), and wroteConfig().

Installer.isUpgrade (  ) 

Returns true iff this is an upgrade process.

Reimplemented in Install, and Upgrade.

Definition at line 112 of file Installer.inc.php.

Installer.parseInstaller (  ) 

Parse the installation descriptor XML file.

Returns:
boolean

Definition at line 227 of file Installer.inc.php.

References HookRegistry.call(), Version.fromString(), getErrorType(), parseInstallNodes(), and setError().

Referenced by execute().

Installer.parseInstallNodes ( &$  installTree  ) 

Parse children nodes in the install descriptor.

Parameters:
$installTree XMLNode

Definition at line 307 of file Installer.inc.php.

References addInstallAction().

Referenced by parseInstaller().

Installer.postInstall (  ) 

Post-installation.

Returns:
boolean

Definition at line 201 of file Installer.inc.php.

References HookRegistry.call().

Referenced by execute().

Installer.preInstall (  ) 

Pre-installation.

Returns:
boolean

Reimplemented in Install.

Definition at line 131 of file Installer.inc.php.

References HookRegistry.call(), Locale.getAllLocales(), DAORegistry.getDAO(), DBConnection.getInstance(), Locale.getLocale(), and setError().

Referenced by execute().

Installer.setError ( type,
msg 
)

Set the error type and messgae.

Parameters:
$type int
$msg string

Definition at line 567 of file Installer.inc.php.

Referenced by Install.createData(), Install.createDatabase(), Install.createDirectories(), executeAction(), parseInstaller(), preInstall(), Install.preInstall(), and updateConfig().

Installer.updateConfig ( configParams  ) 

Update the specified configuration parameters.

Parameters:
$configParams arrays
Returns:
boolean

Definition at line 448 of file Installer.inc.php.

References Config.getConfigFileName(), setError(), and wroteConfig().

Referenced by Install.createConfig().

Installer.updateVersion (  ) 

Update the version number.

Returns:
boolean

Definition at line 279 of file Installer.inc.php.

References HookRegistry.call(), DAORegistry.getDAO(), and getParam().

Referenced by execute().

Installer.wroteConfig (  ) 

Check if installer was able to write out new config file.

Returns:
boolean

Definition at line 523 of file Installer.inc.php.

Referenced by Installer(), and updateConfig().


The documentation for this class was generated from the following file:

Generated on Mon Jul 14 10:55:43 2008 for Open Journal Systems by  doxygen 1.5.6