Open Journal Systems  2.4.3
 All Classes Namespaces Functions Variables Groups Pages
Installer Class Reference
Inheritance diagram for Installer:
Upgrade

Public Member Functions

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

Detailed Description

Base class for install and upgrade scripts.

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

Member Function Documentation

Installer::addInstallAction ( $node)

Add an installer action from the descriptor.

Parameters
$nodeXMLNode

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

Referenced by parseInstallNodes().

Installer::addPluginVersions ( )

Insert or update plugin data in versions and plugin_settings tables.

Returns
boolean

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

References PluginRegistry\getCategories(), Core\getCurrentDate(), DAORegistry\getDAO(), PluginRegistry\getPlugins(), PluginRegistry\loadCategory(), and VersionCheck\parseVersionXML().

Installer::clearDataCache ( )

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

Returns
boolean

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

References DAORegistry\getDAO().

Installer::destroy ( )

Destroy / clean-up after the installer.

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

References HookRegistry\call().

Installer::execute ( )

Installation.

Returns
boolean

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

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

Installer::executeAction (   $action)

Execute a single installer action.

Parameters
$actionarray
Returns
boolean

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

References setError().

Referenced by executeInstaller().

Installer::executeInstaller ( )

Execute the installer actions.

Returns
boolean

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

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

Referenced by execute().

Installer::fileExists (   $filePath)

Check to see whether the passed file exists.

Parameters
$filePathstring
Returns
boolean

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

Installer::getConfigContents ( )

Get the contents of the updated configuration file.

Returns
string

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

& Installer::getCurrentVersion ( )

Return currently installed version.

Returns
Version

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

Referenced by getErrorString().

Installer::getErrorString ( )

Return the error message as a localized string.

Returns
string.

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

References getErrorMsg(), and getErrorType().

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

Referenced by getErrorString(), and parseInstaller().

& Installer::getNewVersion ( )

Return new version after installation.

Returns
Version

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

Installer::getNotes ( )

Get the set of installation notes.

Returns
array

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

Installer::getParam (   $name)

Get the value of an installation parameter.

Parameters
$name
Returns
mixed

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

Referenced by Install\createData().

Installer::getSQL ( )

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

Returns
array

Definition at line 518 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 626 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 94 of file Installer.inc.php.

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

Installer::installFilterConfig (   $filterConfigFile)

Install the given filter configuration file.

Parameters
$filterConfigFilestring
Returns
boolean true when successful, otherwise false

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

Installer::isUpgrade ( )

Returns true iff this is an upgrade process.

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

Installer::parseInstaller ( )

Parse the installation descriptor XML file.

Returns
boolean

Definition at line 232 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
$installTreeXMLNode

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

References addInstallAction().

Referenced by parseInstaller().

Installer::postInstall ( )

Post-installation.

Returns
boolean

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

References HookRegistry\call().

Referenced by execute().

Installer::preInstall ( )

Pre-installation.

Returns
boolean

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

References HookRegistry\call(), PKPLocale\getAllLocales(), DAORegistry\getDAO(), DBConnection\getInstance(), AppLocale\getLocale(), and setError().

Referenced by execute().

Installer::setError (   $type,
  $msg 
)

Set the error type and messgae.

Parameters
$typeint
$msgstring

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

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

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

References DAORegistry\getDAO().

Referenced by Upgrade\migrateDefaultUsageStatistics().

Installer::updateConfig (   $configParams)

Update the specified configuration parameters.

Parameters
$configParamsarrays
Returns
boolean

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

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

Installer::updateVersion ( )

Update the version number.

Returns
boolean

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

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

Referenced by execute().

Installer::wroteConfig ( )

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

Returns
boolean

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

Referenced by Installer(), and updateConfig().


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