Class Upgrade

Description

A class to perform upgrades from phpAdsNew 2.0 or greater, and from previous version of Max.

Located in /libraries/lib-upgrade.inc.php (line 37)


	
			
Variable Summary
 mixed $prefix
 mixed $tables
 mixed $tableType
 mixed $upgradeFrom
 mixed $upgradeTo
Method Summary
 Upgrade Upgrade (string $prefix, mixed $dbConnection)
 boolean previousVersionExists (string $version)
 void upgradeDatabase (array &$errors)
 boolean _compareVersions (string $first, string $second)
 void _runQueries (array &$queries, array &$errors)
 void _upgradeEarly (array &$errors)
 void _upgradeInstalledVersion (array &$errors)
 void _upgradeToTwoOneAlpha (mixed &$errors)
 void _upgradeToTwoZeroAlpha (mixed &$errors)
Variables
mixed $dbConnection (line 40)
mixed $prefix (line 39)
mixed $tables (line 41)
mixed $tableType (line 42)
mixed $upgradeFrom (line 43)
mixed $upgradeTo (line 44)
Methods
Constructor Upgrade (line 53)

The class constructor method.

Upgrade Upgrade (string $prefix, mixed $dbConnection)
  • string $prefix: The table prefix to use for database tables.
  • mixed $dbConnection: A reference to an existing MySQL connection to the admin database.
previousVersionExists (line 75)

A method to determine if an older version of Max (or phpAdsNew) is currently installed.

  • return: True if a previous version of Max is installed, false otherwise.
boolean previousVersionExists (string $version)
  • string $version: The version of Max currently being installed.
upgradeDatabase (line 106)

A method to perform the necessary upgrade steps to update Max to the necessary database format.

void upgradeDatabase (array &$errors)
  • array $errors: A reference to an array to have errors added to it.
_compareVersions (line 142)

A private method for comparing version numbers.

  • return: True if the first version number is greater than the second, false otherwise.
  • private:
boolean _compareVersions (string $first, string $second)
  • string $first: The first version number.
  • string $second: The second version number.
_runQueries (line 627)

A private method for running a series of queries. Checks for various error conditions, and may ignore errors, depending on the query.

  • private:
void _runQueries (array &$queries, array &$errors)
  • array $queries: A reference to an array of SQL queries to run.
  • array $errors: A reference to an array that should contain any errors resulting from running the queries, excluding certain cases.
_upgradeEarly (line 316)

A private method to upgrade the database for all versions

prior to v0.1.16-beta. Note that in some cases, a check is performed to test if the chages have already been made, as the changes cannot be applied twice. In other cases, no check is made, as the changes can simply be ignored by MySQL if they are applied for a second time.

  • private:
void _upgradeEarly (array &$errors)
  • array $errors: A reference to an array to have errors added to it.
_upgradeInstalledVersion (line 204)

A private method for updating the version number

  • private:
void _upgradeInstalledVersion (array &$errors)
  • array $errors: A reference to an array to have errors added to it.
_upgradeToTwoOneAlpha (line 219)

A private method to upgrade the database from the v0.2.0-alpha format to the v0.2.1-alpha format.

  • private:
void _upgradeToTwoOneAlpha (mixed &$errors)
_upgradeToTwoZeroAlpha (line 234)

A private method to upgrade the database from the v0.1.x format to the v0.2.0-alpha format.

  • private:
void _upgradeToTwoZeroAlpha (mixed &$errors)

Documentation generated on Fri, 24 Dec 2004 13:02:29 +0000 by phpDocumentor 1.3.0RC3