~ubuntu-branches/ubuntu/breezy/moodle/breezy

« back to all changes in this revision

Viewing changes to mod/hotpot/db/mysql.php

  • Committer: Bazaar Package Importer
  • Author(s): Andrew Mitchell
  • Date: 2005-10-13 02:00:59 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051013020059-y2qcyo41t7nqppcg
Tags: 1.5.2-1ubuntu1
* Resync with debian (security update)
* changed dependencys to php5
* changed apache dependency to apache2 
* References
  CAN-2005-2247

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?PHP
 
2
 
 
3
function hotpot_upgrade($oldversion) {
 
4
        global $CFG;
 
5
        $ok = true;
 
6
 
 
7
        if ($oldversion < 2004021400) {
 
8
                execute_sql(" ALTER TABLE `{$CFG->prefix}hotpot_events` ADD `starttime` INT(10) unsigned NOT NULL DEFAULT '0' AFTER `time`");
 
9
                execute_sql(" ALTER TABLE `{$CFG->prefix}hotpot_events` ADD `endtime` INT(10) unsigned NOT NULL DEFAULT '0' AFTER `time`");
 
10
        }
 
11
 
 
12
        // update from HotPot v1 to HotPot v2
 
13
        if ($oldversion < 2005031400) {
 
14
                $ok = $ok && hotpot_get_update_to_v2();
 
15
                $ok = $ok && hotpot_update_to_v2_from_v1();
 
16
        }
 
17
 
 
18
        return $ok;
 
19
}
 
20
function hotpot_get_update_to_v2() {
 
21
        global $CFG;
 
22
        $filepath = "$CFG->dirroot/mod/hotpot/db/update_to_v2.php";
 
23
        if (file_exists($filepath) && is_readable($filepath)) {
 
24
                include_once $filepath;
 
25
                $ok = true;
 
26
        } else {
 
27
                $ok = false;
 
28
        }
 
29
        return $ok;
 
30
}
 
31
?>