Six Apart Code

<<

NAME

MT::Upgrade - MT class for managing system upgrades.

SYNOPSIS

    MT::Upgrade->do_upgrade(Install => 1);

DESCRIPTION

This module is responsible for handling the upgrade or installation of an MT database. The framework is flexible enough for third party plugins to use as well to manage their own schema (please refer to the documentation in MT::Plugin for more information on this).

METHODS

MT::Upgrade->do_upgrade

The main worker method for this module is do_upgrade. It accepts a handful of arguments, which are:

  • Install
  • Specify a value of '1' to assume a new installation along with an operation to install a weblog and initial author.

  • App
  • A package name or app object that can service the following methods:

    • progress($package, $message)
    • Called during the upgrade operation to provide feedback with respect to the operations the upgrade process is running.

    • error($package, $message)
    • Called during the upgrade operation to communicate an error that has occurred.

  • CLI
  • Specified (set to '1') when invoked from a command line tool. This prevents encoding response messages in the configured PublishCharset for the installation.

  • SuperUser
  • If upgrading from the command line, and running on a pre-MT 3.2 database, set this to an existing author ID that should be upgrade to system administrator status.

  • DryRun
  • Specified (set to '1') to examine the database for installation/upgrade needs but not actually make any physical changes to the database. This will issue all the upgrade progress messages without doing the upgrade itself.

CALLBACKS

The upgrade module defines the following MT callbacks:

  • MT::Upgrade::SQL
  • Called with each SQL statement that is executed against the database as part of the upgrade process. The parameters passed to this callback are:

        $callback, $upgrade_app, $sql_statement

    The first parameter is an MT::Callback object. $upgrade_app is a package name or MT::App object used to drive the upgrade process. $sql_statement is the actual SQL query that is about to be executed against the database.

AUTHOR & COPYRIGHTS

Please see the MT manpage for author, copyright, and license information.

<<

Six Apart
Makers of weblog software and services for individuals, organizations and businesses.