This space is archived

For current information please use the current ExamSys documentation

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Purpose

The upgrade scripts (e.g. `/updates/version5.php`) have two main purposes: 1) alter the database structure to match the new code, and 2) alter/add settings into `/config/config.inc.php`. Sometimes an upgrade script may be used to 'fix' content that is wrong in the database - update the content of a question(s) that has become corrupted or student answers that are incorrectly saved.

The overall principle of the upgrade script is to take any sub-version of Rogo and upgrade to the latest. To do this it will actively look at the database and configuration file and determine what changes are necessary. This allows for the script to be safely run more than once and not get too many fields add to the database.

Principles

  1. Each major version release of Rogo has its own update file. So the version 5 branch uses /updates/version5.php. Different files are used for different versions for speed, otherwise there would be too many checks. Each upgrade script will take a Rogo install to the start of the next version. For example, /updates/version5.php will upgrade any version 5 all the way to the start of the 6.0 branch.
  2. The files in the /updates/version5/ directory gets automatically included when /updates/version5.php is run. Each separate update check is in its own file. The reason for this is to avoid conflicts when working in a large team when multiple programmers may all need to change the main update script. This approach solves the conflict issue because separate files are used.
  3. Some actions such as transforming content into a different format should only be performed once. Because an update script may be run several times in a major release branch it is important that the transformation is not reapplied. To solve this (starting at Rogo 6.0) there is a new database tabled called sys_updates. Two functions record_update and has_updated can be used to record and check whether an update has been done respectively.
  • No labels