Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
Installer Class Reference
Inheritance diagram for Installer:
Upgrade

Public Member Functions

 abort ($installer, $attr)
 
 addInstallAction ($node)
 
 addPluginVersions ()
 
 clearDataCache ()
 
 columnExists ($tableName, $columnName)
 
 destroy ()
 
 execute ()
 
 executeAction ($action)
 
 executeInstaller ()
 
 executeSQL ($sql)
 
 getConfigContents ()
 
 getCurrentVersion ()
 
 getErrorMsg ()
 
 getErrorString ()
 
 getErrorType ()
 
 getNewVersion ()
 
 getNotes ()
 
 getParam ($name)
 
 getSQL ()
 
 installEmailTemplate ($installer, $attr)
 
 Installer ($descriptor, $params=array(), $isPlugin=false)
 
 installFilterConfig ($filterConfigFile)
 
 isUpgrade ()
 
 log ($message)
 
 parseInstaller ()
 
 parseInstallNodes ($installTree)
 
 postInstall ()
 
 preInstall ()
 
 setCurrentVersion ($version)
 
 setError ($type, $msg)
 
 setLogger ($logger)
 
 tableExists ($tableName)
 
 updateConfig ($configParams)
 
 updateVersion ()
 
 wroteConfig ()
 

Public Attributes

 $actions
 
 $configContents
 
 $currentVersion
 
 $dataXMLParser
 
 $dbconn
 
 $descriptor
 
 $errorMsg
 
 $errorType
 
 $installedLocales
 
 $isPlugin
 
 $locale
 
 $logger
 
 $newVersion
 
 $notes
 
 $params
 
 $sql
 
 $wroteConfig
 

Detailed Description

Base class for install and upgrade scripts.

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

Member Function Documentation

Installer::abort (   $installer,
  $attr 
)

Fail the upgrade.

Parameters
$installerInstaller
$attrarray Attributes
Returns
boolean

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

Installer::addInstallAction (   $node)

Add an installer action from the descriptor.

Parameters
$nodeXMLNode

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

Installer::addPluginVersions ( )

Insert or update plugin data in versions and plugin_settings tables.

Returns
boolean

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

Installer::clearDataCache ( )

Clear the data cache files (needed because of direct tinkering with settings tables)

Returns
boolean

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

Installer::columnExists (   $tableName,
  $columnName 
)

Check to see whether a column exists. Used in installer XML in conditional checks on <data> nodes.

Parameters
$tableNamestring
$columnNamestring
Returns
boolean

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

Installer::destroy ( )

Destroy / clean-up after the installer.

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

Installer::execute ( )

Installation.

Returns
boolean

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

References $currentVersion, $descriptor, Version\fromString(), log(), parseInstallNodes(), and setError().

Installer::executeAction (   $action)

Execute a single installer action.

Parameters
$actionarray
Returns
boolean

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

Referenced by log().

Installer::executeInstaller ( )

Execute the installer actions.

Returns
boolean

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

References parseInstallNodes().

Installer::executeSQL (   $sql)

Execute an SQL statement.

Parameters
$sqlmixed
Returns
boolean

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

Referenced by parseInstallNodes().

Installer::getConfigContents ( )

Get the contents of the updated configuration file.

Returns
string

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

Installer::getCurrentVersion ( )

Return currently installed version.

Returns
Version

Definition at line 541 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 603 of file Installer.inc.php.

Installer::getErrorString ( )

Return the error message as a localized string.

Returns
string.

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

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 593 of file Installer.inc.php.

Installer::getNewVersion ( )

Return new version after installation.

Returns
Version

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

Installer::getNotes ( )

Get the set of installation notes.

Returns
array

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

Installer::getParam (   $name)

Get the value of an installation parameter.

Parameters
$name
Returns
mixed

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

Installer::getSQL ( )

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

Returns
array

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

Installer::installEmailTemplate (   $installer,
  $attr 
)

For upgrade: install email templates and data

Parameters
$installerobject
$attrarray Attributes: array containing 'key' => 'EMAIL_KEY_HERE', 'locales' => 'en_US,fr_CA,...'

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

References DAORegistry\getDAO().

Installer::Installer (   $descriptor,
  $params = array(),
  $isPlugin = false 
)

Constructor.

Parameters
$descriptorstring descriptor path
$paramsarray installer parameters
$isPluginboolean true iff a plugin is being installed

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

Installer::installFilterConfig (   $filterConfigFile)

Install the given filter configuration file.

Parameters
$filterConfigFilestring
Returns
boolean true when successful, otherwise false

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

Installer::isUpgrade ( )

Returns true iff this is an upgrade process.

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

Installer::log (   $message)

Record message to installation log.

Parameters
$messagestring

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

References executeAction().

Referenced by execute(), and parseInstallNodes().

Installer::parseInstaller ( )

Parse the installation descriptor XML file.

Returns
boolean

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

Installer::parseInstallNodes (   $installTree)

Parse children nodes in the install descriptor.

Parameters
$installTreeXMLNode

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

References $sql, executeSQL(), log(), and setError().

Referenced by execute(), and executeInstaller().

Installer::postInstall ( )

Post-installation.

Returns
boolean

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

Installer::preInstall ( )

Pre-installation.

Returns
boolean

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

Installer::setCurrentVersion (   $version)

Set the current version for this installer.

Parameters
$versionVersion

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

Installer::setError (   $type,
  $msg 
)

Set the error type and messgae.

Parameters
$typeint
$msgstring Text message (INSTALLER_ERROR_DB) or locale key (otherwise)

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

Referenced by execute(), and parseInstallNodes().

Installer::setLogger (   $logger)

Set the logger for this installer.

Parameters
$loggerLogger

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

Installer::tableExists (   $tableName)

Check to see whether a table exists. Used in installer XML in conditional checks on <data> nodes.

Parameters
$tableNamestring
Returns
boolean

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

Installer::updateConfig (   $configParams)

Update the specified configuration parameters.

Parameters
$configParamsarrays
Returns
boolean

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

References $sql.

Installer::updateVersion ( )

Update the version number.

Returns
boolean

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

Installer::wroteConfig ( )

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

Returns
boolean

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

Member Data Documentation

array Installer::$actions

installer actions to be performed

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

string Installer::$configContents

contents of the updated config file

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

Version Installer::$currentVersion

currently installed version

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

Referenced by execute().

DBDataXMLParser Installer::$dataXMLParser

database data parser

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

ADOConnection Installer::$dbconn

database connection

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

string Installer::$descriptor

descriptor path (relative to INSTALLER_DATA_DIR)

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

Referenced by execute(), and Install\Install().

string Installer::$errorMsg

the error message, if an installation error has occurred

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

int Installer::$errorType

error code (null | INSTALLER_ERROR_GENERAL | INSTALLER_ERROR_DB)

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

string Installer::$installedLocales

available locales

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

boolean Installer::$isPlugin

indicates if a plugin is being installed (thus modifying the descriptor path)

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

Referenced by Install\Install(), and Upgrade\Upgrade().

string Installer::$locale

default locale

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

Logger Installer::$logger

logging object

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

Version Installer::$newVersion

version after installation

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

array Installer::$notes

installation notes

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

array Installer::$params

installation parameters

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

Referenced by Install\Install(), and Upgrade\Upgrade().

array Installer::$sql

SQL statements for database installation

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

Referenced by parseInstallNodes(), and updateConfig().

boolean Installer::$wroteConfig

indicating if config file was written or not

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


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