we usually use include instead of require for plugin files
[moodle.git] / message / output / popup / db / upgrade.php
CommitLineData
3b120e46 1<?php
2
3///////////////////////////////////////////////////////////////////////////
4// //
5// NOTICE OF COPYRIGHT //
6// //
7// Moodle - Modular Object-Oriented Dynamic Learning Environment //
8// http://moodle.com //
9// //
10// Copyright (C) 1999 onwards Martin Dougiamas http://moodle.com //
11// //
12// This program is free software; you can redistribute it and/or modify //
13// it under the terms of the GNU General Public License as published by //
14// the Free Software Foundation; either version 2 of the License, or //
15// (at your option) any later version. //
16// //
17// This program is distributed in the hope that it will be useful, //
18// but WITHOUT ANY WARRANTY; without even the implied warranty of //
19// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
20// GNU General Public License for more details: //
21// //
22// http://www.gnu.org/copyleft/gpl.html //
23// //
24///////////////////////////////////////////////////////////////////////////
25
26/**
27 * Upgrade code for popup message processor
28 *
29 * @author Luis Rodrigues
3b120e46 30 * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
1d422980 31 * @package
3b120e46 32 */
33
775f811a 34function xmldb_message_popup_upgrade($oldversion) {
35 global $CFG, $DB;
3b120e46 36
775f811a 37 $dbman = $DB->get_manager();
3b120e46 38 $result = true;
39
40 if ($result && $oldversion < 2008072401) {
41 $processor = new object();
42 $processor->name = 'popup';
43 if (! $DB->record_exists('message_processors', array('name' => $processor->name))){
44 $result = $result && $DB->insert_record('message_processors', $processor);
45 }
3eb7ecda 46
47 /// popup savepoint reached
48 upgrade_plugin_savepoint($result, 2008072401, 'message', 'popup');
49 }
3b120e46 50
51 return $result;
52}
53
1d422980 54