You have probably read about updates in Cotonti and know how to update the system in general. This article describes extension updates in detail. The word 'extension' means both 'module' and 'plugin' as a more general term in Cotonti.
#1. When extensions are updated
There are 2 cases when extensions are updated:
- When you run install.php script to update your system as described here. In this case the update script checks versions of all installed extensions against versions of extension setup files on disk and updates only those, which have been updated on disk (have higher version numbers).
- When you click "Update" button in Administration → Extensions → Extension_name. In this case the system attempts to update the extension regardless of installed / available version numbers.
It is highly recommended to use "Update" feature instead of reinstalling extensions. Reinstalls were necessary in Cotonti 0.6.x, but there is no need to do them anymore. Update works a lot smarter.
#2. Update process for a particular extension
For each updated extension Cotonti applies the following procedure:
- Calculates difference between installed extension version in the database and available extension version in extension_name.setup.php on disk.
- Removes current hook handlers and installs them all again. This is necessary if there are new hook handler parts in the extension or some old parts have been removed or meta-information for some parts (e.g. used hooks) has changed.
- Updates configuration. It adds new options if there are any. It removes options which have been removed from the extension. It modifies and resets to default values those options for which option type has been changed. All the rest is left untouched.
- The same as step 3 is applied to structure configuration.
- Updates permission Auth/Lock masks for 'members' and 'guests' groups.
- Applies PHP and SQL patches from extension's 'setup' subfolder in the sequential order, based on the difference between installed and available version.
- Updates extension version in the database and clears cache.