Next Previous Contents

6. Automated Installation and Upgrade Notes (For Developers)

There is a new folder named "install" which contains files use by the new script called setup.php. This is an automated web-based update/installation script. Here is how it works for users:

  1. The user loads setup.php into their browser. They can either select the new installation link, or one of the upgrade links.
  2. For a new installation:
    1. The user will be prompted to enter a priviledged mysql username and password. This is for the database creation and grant assignments. The script will then proceed to install all the necessary data structures and default data entries for the most current version of ODM.
  3. For updates:
    1. The user will need to find their current version (which comes from their old config.php), and they would then click on the appropriate upgrade link. For example, if their version number is 1.0, they would click on the "Upgrade from 1.0" link. This will apply all necessary database changes to their current database.

For developers, when there is a new version release, a few new files need to be created and a current files modified.

  1. upgrade_x.php - where x is the release name. This file should follow the same format as the other upgrade_x.php files and is used for upgrades only. This should be built from the output of a program like mysqldiff.pl and is the "diff"erence between the it's version, and the version before it.
  2. Setup.php - add a new function for the new version upgrade (ex. "do_update_x()") where x is the release name.
    1. Inside this new function, you must "include" each previous upgrade file in succession (see upgrade_10.php for an exmaple, which is for a user upgrading from 1.0 to the latest).
    2. Add a new case statement for the new upgrade call
    3. Add a new link to print_intro() for the upgrade function
  3. odm.php - This file should follow the same format as the current odm.php file, and should contain all the necessary sql commands to create a new installation based on the latest database schema.
  4. database.sql - This should contain the same sql commands as odm.php, only in a mysqldump format for users that need to manually install the program for some reason. This can be a mysqldump straight from the latest database schema.

These files MUST be kept syncronized for each release!


Next Previous Contents