Difference between revisions of "Upgrade notification"
|Line 15:||Line 15:|
Simple PHP script which accepts one optional parameter ''release'' (ex.:
Simple PHP script which accepts one optional parameter ''release'' (ex.:) and returns XML file which includes following info describing all branches:
Revision as of 22:38, 5 October 2009
- PROJECT STATE: Proposal, probably to be included in 1.9.x
- MAIN TRACKER ISSUE: MDL-20438
- DISCUSSION AND COMMENTS: n/a
- AUTHOR: Petr Škoda (škoďák) + feedback and ideas from other developers
- TIME NEEDED FOR IMPLEMENTATION: 2 days
The mandatory security measure is to always keep Moodle software up to date. This page describes new mechanism that notifies each admin about available Moodle upgrades. At present upgrade information is available from moodle.org site, we are also sending new version notices via email to registered administrators. Unfortunately many sites are not upgraded regularly :-(
The general idea is that each Moodle instance contacts regularly (every 7 days) moodle.org and fetches the latest version information. Admin is notified by own server when any new version available. The notification would be also printed on the security overview report, the site notification and the front page (only when admin logged in). Admins would be also notified when branch not maintained any more.
The side effect would be that we could get much better version statistics, of course we need to provide an opt-out option ;-)
Simple PHP script which accepts one optional parameter release (ex.:1.9.5+(Build:20091005)) and returns XML file which includes following info describing all branches:
<?xml version="1.0" encoding="UTF-8" ?> <UPTODATE_INFO> <BRANCH version="1.9"> <VERSION>2007101560</VERSION> <RELEASE>1.9.6</RELEASE> <MAINTENANCE_END /> </BRANCH> </UPTODATE_INFO> </xml>
New Function lib/adminlib.php/uptodate_info() - uses standard download_file_content() to fetch XML info from http://moodle.org/uptodate_info.php?release=1.9.5+(Build:20091005)
The XML info is parsed and results stored in the config table:
- $CFG->uptodate_status (0 - ok, 1 - needs update, 3 branch not maintained)
- $CFG->uptodate_fetched (date when fetched from moodle.org)
The update function is triggered:
- every 7 days from cron.php
- after each upgrade
User interface consists of:
- notification for admins on the admin/index.php - warning if disabled or new info can not be fetched; ok message when latest version
- notification for admins on the front page - configurable
- admin setting - disable fetching of info from moodle.org
- security overview report - critical warning when disabled or not up-to-date
- How to deal with weekly builds? - Should we include build date? What upgrade to recommend?
- How to deal with development snapshots? Show big warning in alpha versions (==before branching)?