|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 // This file is part of Moodle - http://moodle.org/ 00003 // 00004 // Moodle is free software: you can redistribute it and/or modify 00005 // it under the terms of the GNU General Public License as published by 00006 // the Free Software Foundation, either version 3 of the License, or 00007 // (at your option) any later version. 00008 // 00009 // Moodle is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 // GNU General Public License for more details. 00013 // 00014 // You should have received a copy of the GNU General Public License 00015 // along with Moodle. If not, see <http://www.gnu.org/licenses/>. 00016 00027 // Sometimes, changes between versions involve 00028 // alterations to database structures and other 00029 // major things that may break installations. 00030 // 00031 // The upgrade function in this file will attempt 00032 // to perform all the necessary actions to upgrade 00033 // your older installation to the current version. 00034 // 00035 // If there's something it cannot do itself, it 00036 // will tell you what you need to do. 00037 // 00038 // The commands in here will all be database-neutral, 00039 // using the methods of database_manager class 00040 // 00041 // Please do not forget to use upgrade_set_timeout() 00042 // before any action that may take longer time to finish. 00043 00044 function xmldb_enrol_paypal_upgrade($oldversion) { 00045 global $CFG, $DB, $OUTPUT; 00046 00047 $dbman = $DB->get_manager(); 00048 00049 //===== 1.9.0 upgrade line ======// 00050 00051 // Add instanceid field to enrol_paypal table 00052 if ($oldversion < 2010071500) { 00053 $table = new xmldb_table('enrol_paypal'); 00054 $field = new xmldb_field('instanceid'); 00055 if (!$dbman->field_exists($table, $field)) { 00056 $field->set_attributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, 0, 'userid'); 00057 $dbman->add_field($table, $field); 00058 } 00059 upgrade_plugin_savepoint(true, 2010071500, 'enrol', 'paypal'); 00060 } 00061 00062 // Moodle v2.1.0 release upgrade line 00063 // Put any upgrade step following this 00064 00065 // Moodle v2.2.0 release upgrade line 00066 // Put any upgrade step following this 00067 00068 return true; 00069 }