]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-15246 moving all remaining ddl function to adminlib, keeping old lib/ddllib.php...
authorskodak <skodak>
Sun, 15 Jun 2008 10:32:50 +0000 (10:32 +0000)
committerskodak <skodak>
Sun, 15 Jun 2008 10:32:50 +0000 (10:32 +0000)
61 files changed:
admin/blocks.php
admin/cliupgrade.php
admin/index.php
admin/modules.php
admin/xmldb/actions/check_bigints/check_bigints.class.php
admin/xmldb/actions/check_defaults/check_defaults.class.php
admin/xmldb/actions/check_indexes/check_indexes.class.php
admin/xmldb/index.php
backup/db/upgrade.php
blocks/activity_modules/db/upgrade.php
blocks/admin/db/upgrade.php
blocks/calendar_month/db/upgrade.php
blocks/calendar_upcoming/db/upgrade.php
blocks/course_list/db/upgrade.php
blocks/course_summary/db/upgrade.php
blocks/db/upgrade.php
blocks/news_items/db/upgrade.php
blocks/online_users/db/upgrade.php
blocks/participants/db/upgrade.php
blocks/recent_activity/db/upgrade.php
blocks/rss_client/db/upgrade.php
blocks/search/db/upgrade.php
blocks/search_forums/db/upgrade.php
blocks/section_links/db/upgrade.php
blocks/social_activities/db/upgrade.php
enrol/authorize/db/upgrade.php
enrol/paypal/db/upgrade.php
lib/accesslib.php
lib/adminlib.php
lib/db/upgrade.php
lib/ddl/database_manager.php
lib/ddl/mssql_sql_generator.php
lib/ddl/simpletest/testddllib.php
lib/ddl/sql_generator.php
lib/ddllib.php
lib/deprecatedlib.php
lib/dml/moodle_database.php
lib/simpletest/fixtures/gradetest.php
mod/assignment/db/upgrade.php
mod/chat/db/upgrade.php
mod/choice/db/upgrade.php
mod/data/db/upgrade.php
mod/feedback/db/upgrade.php
mod/forum/db/upgrade.php
mod/glossary/db/upgrade.php
mod/label/db/upgrade.php
mod/lesson/db/upgrade.php
mod/quiz/db/upgrade.php
mod/resource/db/upgrade.php
mod/scorm/db/upgrade.php
mod/survey/db/upgrade.php
mod/wiki/db/upgrade.php
question/type/calculated/db/upgrade.php
question/type/essay/db/upgrade.php
question/type/match/db/upgrade.php
question/type/multianswer/db/upgrade.php
question/type/multichoice/db/upgrade.php
question/type/numerical/db/upgrade.php
question/type/randomsamatch/db/upgrade.php
question/type/shortanswer/db/upgrade.php
question/type/truefalse/db/upgrade.php

index 162cbcfcc027286ffa761896f0666360e59a8601..6195cb75743a93459afb8acd45e279953627573a 100644 (file)
@@ -6,7 +6,6 @@
     require_once($CFG->libdir.'/adminlib.php');
     require_once($CFG->libdir.'/blocklib.php');
     require_once($CFG->libdir.'/tablelib.php');
-    require_once($CFG->libdir.'/ddllib.php');
 
     admin_externalpage_setup('manageblocks');
 
index e17821cbea5253866234d50ca607eb451cf70b1f..fb36a2a75ccc0baad5cfcd030619779d60a6abd5 100644 (file)
@@ -717,7 +717,6 @@ if ( file_exists(dirname(dirname(__FILE__)) . '/config.php')) {
 
     require_once(dirname(dirname(__FILE__)) . '/config.php');
     require_once($CFG->libdir.'/adminlib.php');  // Contains various admin-only functions
-    require_once($CFG->libdir.'/ddllib.php'); // Install/upgrade related db functions
 
     /**
      * @todo check upgrade status, if upgrader is running already, notify user and exit. 
index e04540af0ffdf4ab2db4e2b329b37d36e739ca59..8736dfbcd6c3cec73005401b2f311af3091024be 100644 (file)
@@ -23,7 +23,6 @@
 
     require_once('../config.php');
     require_once($CFG->libdir.'/adminlib.php');  // Contains various admin-only functions
-    require_once($CFG->libdir.'/ddllib.php'); // Install/upgrade related db functions
     require_once($CFG->libdir.'/db/upgradelib.php');  // Upgrade-related functions
 
     $id             = optional_param('id', '', PARAM_TEXT);
index 9c55fdf510f4ed5b66ce67df25f83104c1fa4cf0..450b8003c50403502a415e55f227f05f7a55f562 100644 (file)
@@ -5,7 +5,6 @@
     require_once('../course/lib.php');
     require_once($CFG->libdir.'/adminlib.php');
     require_once($CFG->libdir.'/tablelib.php');
-    require_once($CFG->libdir.'/ddllib.php');
 
     // defines
     define('MODULE_TABLE','module_administration_table');
index 8553d61b4968a489bdb8ed7569872bc533e7e155..bb3ef49b5a924ddb86c14279df1b7fa631927ad6 100644 (file)
@@ -81,9 +81,6 @@ class check_bigints extends XMLDBAction {
         $dbman = $DB->get_manager();
         $dbfamily = $DB->get_dbfamily();
 
-    /// And we nedd some ddl suff
-        require_once ($CFG->libdir . '/ddllib.php');
-
     /// Here we'll acummulate all the wrong fields found
         $wrong_fields = array();
 
index 8f6cde2232cb94f8a293071a8d2eba015940fdff..c63956d5135337a66f2ee928c8d8d06c8bd09947 100644 (file)
@@ -79,7 +79,6 @@ class check_defaults extends XMLDBAction {
         global $CFG, $XMLDB, $DB;
 
     /// And we nedd some ddl suff
-        require_once ($CFG->libdir . '/ddllib.php');
         $dbman = $DB->get_manager();
 
     /// Here we'll acummulate all the wrong fields found
index 7b347faab399c9f465e243cec1c457251aea78c7..a39c0ad27246bd68edf8a5a64ce5c1331d5bb635 100644 (file)
@@ -78,9 +78,6 @@ class check_indexes extends XMLDBAction {
 
         $dbman = $DB->get_manager();
 
-    /// And we nedd some ddl suff
-        require_once ($CFG->libdir . '/ddllib.php');
-
     /// Here we'll acummulate all the missing indexes found
         $missing_indexes = array();
 
index 546d4323e37a8e99729804cb277105cf7da90812..f2f7adb9fbfc5793e429efb5c361a334147244a7 100644 (file)
@@ -50,7 +50,6 @@
 /// getting "incomplete" objects
     require_once('../../config.php');
     require_once($CFG->libdir.'/adminlib.php');
-    require_once($CFG->libdir.'/ddllib.php'); // Install/upgrade related db functions
 
     admin_externalpage_setup('xmldbeditor');
 
index bc1af02f28f7db34bb56e9f38d698c18a45a6400..de6597c6f40782a40ada4e0c120780b9b8f43f64 100644 (file)
@@ -15,7 +15,7 @@
 // will tell you what you need to do.
 //
 // The commands in here will all be database-neutral,
-// using the functions defined in lib/ddllib.php
+// using the methods of database_manager class
 
 function xmldb_backup_upgrade($oldversion=0) {
 
@@ -29,7 +29,7 @@ function xmldb_backup_upgrade($oldversion=0) {
 /// upgrade code.
 
 /// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
-///     $result = result of "/lib/ddllib.php" function calls
+///     $result = result of database_manager methods
 /// }
 
     return $result;
index 0a0623f9ba0829791d7d3c6bb87baf86f136b4d6..9cd056bdae63f942ebea756b416169ce381c5ec1 100644 (file)
@@ -15,7 +15,7 @@
 // will tell you what you need to do.
 //
 // The commands in here will all be database-neutral,
-// using the functions defined in lib/ddllib.php
+// using the methods of database_manager class
 
 function xmldb_block_activity_modules_upgrade($oldversion=0) {
 
@@ -29,7 +29,7 @@ function xmldb_block_activity_modules_upgrade($oldversion=0) {
 /// upgrade code.
 
 /// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
-///     $result = result of "/lib/ddllib.php" function calls
+///     $result = result of database_manager methods
 /// }
 
     return $result;
index 115f3ce6d0de7a923924695488bf404238725ba8..fc6ef1403d071c44f695d0ea4b1ba9fbbef9ba8b 100644 (file)
@@ -15,7 +15,7 @@
 // will tell you what you need to do.
 //
 // The commands in here will all be database-neutral,
-// using the functions defined in lib/ddllib.php
+// using the methods of database_manager class
 
 function xmldb_block_admin_upgrade($oldversion=0) {
 
@@ -29,7 +29,7 @@ function xmldb_block_admin_upgrade($oldversion=0) {
 /// upgrade code.
 
 /// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
-///     $result = result of "/lib/ddllib.php" function calls
+///     $result = result of database_manager methods
 /// }
 
     return $result;
index 99ff41a4489f772c00b19f731c67beedff1324fe..ba3745b09e8f8f486ae99f3751533c223ff5bf63 100644 (file)
@@ -15,7 +15,7 @@
 // will tell you what you need to do.
 //
 // The commands in here will all be database-neutral,
-// using the functions defined in lib/ddllib.php
+// using the methods of database_manager class
 
 function xmldb_block_calendar_month_upgrade($oldversion=0) {
 
@@ -29,7 +29,7 @@ function xmldb_block_calendar_month_upgrade($oldversion=0) {
 /// upgrade code.
 
 /// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
-///     $result = result of "/lib/ddllib.php" function calls
+///     $result = result of database_manager methods
 /// }
 
     return $result;
index 2c4cefb2e97b0bd3e1392698646676c3ba488c47..1ee5c024f3ad8f231dd28a8bc2ab3cfaadd6a5d2 100644 (file)
@@ -15,7 +15,7 @@
 // will tell you what you need to do.
 //
 // The commands in here will all be database-neutral,
-// using the functions defined in lib/ddllib.php
+// using the methods of database_manager class
 
 function xmldb_block_calendar_upcoming_upgrade($oldversion=0) {
 
@@ -29,7 +29,7 @@ function xmldb_block_calendar_upcoming_upgrade($oldversion=0) {
 /// upgrade code.
 
 /// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
-///     $result = result of "/lib/ddllib.php" function calls
+///     $result = result of database_manager methods
 /// }
 
     return $result;
index b5c3bd8365e8b1a0f0239c498e03d844426c6146..fb46ad1b6e47130db183ea7f28fe93b5ecca2875 100644 (file)
@@ -15,7 +15,7 @@
 // will tell you what you need to do.
 //
 // The commands in here will all be database-neutral,
-// using the functions defined in lib/ddllib.php
+// using the methods of database_manager class
 
 function xmldb_block_course_list_upgrade($oldversion=0) {
 
@@ -29,7 +29,7 @@ function xmldb_block_course_list_upgrade($oldversion=0) {
 /// upgrade code.
 
 /// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
-///     $result = result of "/lib/ddllib.php" function calls
+///     $result = result of database_manager methods
 /// }
 
     return $result;
index 633555bbabbb71ac16293cf5fafd4682ebfbc753..28f823ce7c91de0643f4a7b75a7c2f0ae3976b3d 100644 (file)
@@ -15,7 +15,7 @@
 // will tell you what you need to do.
 //
 // The commands in here will all be database-neutral,
-// using the functions defined in lib/ddllib.php
+// using the methods of database_manager class
 
 function xmldb_block_course_summary_upgrade($oldversion=0) {
 
@@ -29,7 +29,7 @@ function xmldb_block_course_summary_upgrade($oldversion=0) {
 /// upgrade code.
 
 /// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
-///     $result = result of "/lib/ddllib.php" function calls
+///     $result = result of database_manager methods
 /// }
 
     return $result;
index 66740a17d7ef16d2cdd2d01c5766846707c74bf0..784808bb437889a1daebb79ea8d94624c27ba86a 100644 (file)
@@ -15,7 +15,7 @@
 // will tell you what you need to do.
 //
 // The commands in here will all be database-neutral,
-// using the functions defined in lib/ddllib.php
+// using the methods of database_manager class
 
 function xmldb_blocks_upgrade($oldversion=0) {
 
@@ -31,7 +31,7 @@ function xmldb_blocks_upgrade($oldversion=0) {
 /// upgrade code.
 
 /// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
-///     $result = result of "/lib/ddllib.php" function calls
+///     $result = result of database_manager methods
 /// }
 
     if ($result && $oldversion < 2007081300) {
index ee40a9d107102ed271749362c26e6dce1896e32b..bd9b97562b3b613180f1f38921ceea394750629d 100644 (file)
@@ -15,7 +15,7 @@
 // will tell you what you need to do.
 //
 // The commands in here will all be database-neutral,
-// using the functions defined in lib/ddllib.php
+// using the methods of database_manager class
 
 function xmldb_block_news_items_upgrade($oldversion=0) {
 
@@ -29,7 +29,7 @@ function xmldb_block_news_items_upgrade($oldversion=0) {
 /// upgrade code.
 
 /// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
-///     $result = result of "/lib/ddllib.php" function calls
+///     $result = result of database_manager methods
 /// }
 
     return $result;
index 31f3632c57622e445d0756f9acc3a7fa8f9dc394..334c81f696228fac12bea1f8f080ad9ce9ad7dd5 100644 (file)
@@ -15,7 +15,7 @@
 // will tell you what you need to do.
 //
 // The commands in here will all be database-neutral,
-// using the functions defined in lib/ddllib.php
+// using the methods of database_manager class
 
 function xmldb_block_online_users_upgrade($oldversion=0) {
 
@@ -29,7 +29,7 @@ function xmldb_block_online_users_upgrade($oldversion=0) {
 /// upgrade code.
 
 /// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
-///     $result = result of "/lib/ddllib.php" function calls
+///     $result = result of database_manager methods
 /// }
 
     return $result;
index faea7eb5ffc9eb094d4024fca9569aafcd8da6cc..9decca3880121b50c02b8a79e00513409ba01daf 100644 (file)
@@ -15,7 +15,7 @@
 // will tell you what you need to do.
 //
 // The commands in here will all be database-neutral,
-// using the functions defined in lib/ddllib.php
+// using the methods of database_manager class
 
 function xmldb_block_participants_upgrade($oldversion=0) {
 
@@ -29,7 +29,7 @@ function xmldb_block_participants_upgrade($oldversion=0) {
 /// upgrade code.
 
 /// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
-///     $result = result of "/lib/ddllib.php" function calls
+///     $result = result of database_manager methods
 /// }
 
     return $result;
index 36b534eb30f50f39e19c795e2ec99893a3b9c33c..65082fd96293c45fba992d8318ff43cc834ef298 100644 (file)
@@ -15,7 +15,7 @@
 // will tell you what you need to do.
 //
 // The commands in here will all be database-neutral,
-// using the functions defined in lib/ddllib.php
+// using the methods of database_manager class
 
 function xmldb_block_recent_activity_upgrade($oldversion=0) {
 
@@ -29,7 +29,7 @@ function xmldb_block_recent_activity_upgrade($oldversion=0) {
 /// upgrade code.
 
 /// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
-///     $result = result of "/lib/ddllib.php" function calls
+///     $result = result of database_manager methods
 /// }
 
     return $result;
index 90996fbc78501b89da50607c1f5c6382917378f7..c8261d020cbf1a6fa9d36d516a7512653c4cfb2a 100644 (file)
@@ -15,7 +15,7 @@
 // will tell you what you need to do.
 //
 // The commands in here will all be database-neutral,
-// using the functions defined in lib/ddllib.php
+// using the methods of database_manager class
 
 function xmldb_block_rss_client_upgrade($oldversion=0) {
 
index ef8679042e841cf93de70f954e7881ec93d2039b..80ce4c4b5a5899dda8a12cdad42ca258397f343e 100644 (file)
@@ -15,7 +15,7 @@
 // will tell you what you need to do.
 //
 // The commands in here will all be database-neutral,
-// using the functions defined in lib/ddllib.php
+// using the methods of database_manager class
 
 function xmldb_block_search_upgrade($oldversion=0) {
 
@@ -29,7 +29,7 @@ function xmldb_block_search_upgrade($oldversion=0) {
 /// upgrade code.
 
 /// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
-///     $result = result of "/lib/ddllib.php" function calls
+///     $result = result of database_manager methods
 /// }
 
 //===== 1.9.0 upgrade line ======//
index ec4a9b84c3c850030d4021cb7dcf260519606cca..99ae3c9ae85a18ad353946c283f65fab3d4ec151 100644 (file)
@@ -15,7 +15,7 @@
 // will tell you what you need to do.
 //
 // The commands in here will all be database-neutral,
-// using the functions defined in lib/ddllib.php
+// using the methods of database_manager class
 
 function xmldb_block_search_forums_upgrade($oldversion=0) {
 
@@ -29,7 +29,7 @@ function xmldb_block_search_forums_upgrade($oldversion=0) {
 /// upgrade code.
 
 /// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
-///     $result = result of "/lib/ddllib.php" function calls
+///     $result = result of database_manager methods
 /// }
 
     return $result;
index 67b3b1bbbd21ee74353879b4e434ad4a77247869..2e1c6dfab744b6105b3cd35c52e49a408632f913 100644 (file)
@@ -15,7 +15,7 @@
 // will tell you what you need to do.
 //
 // The commands in here will all be database-neutral,
-// using the functions defined in lib/ddllib.php
+// using the methods of database_manager class
 
 function xmldb_block_section_links_upgrade($oldversion=0) {
 
@@ -29,7 +29,7 @@ function xmldb_block_section_links_upgrade($oldversion=0) {
 /// upgrade code.
 
 /// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
-///     $result = result of "/lib/ddllib.php" function calls
+///     $result = result of database_manager methods
 /// }
 
     return $result;
index 491f2418499b9bc7ac9113c1c6abe47081902ff4..914bd22ca9595dec9d2093de80a6986405d0e4aa 100644 (file)
@@ -15,7 +15,7 @@
 // will tell you what you need to do.
 //
 // The commands in here will all be database-neutral,
-// using the functions defined in lib/ddllib.php
+// using the methods of database_manager class
 
 function xmldb_block_social_activities_upgrade($oldversion=0) {
 
@@ -29,7 +29,7 @@ function xmldb_block_social_activities_upgrade($oldversion=0) {
 /// upgrade code.
 
 /// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
-///     $result = result of "/lib/ddllib.php" function calls
+///     $result = result of database_manager methods
 /// }
 
     return $result;
index a0ab95156e19bb0c51af89ea19fcb1e3d7db6f4f..37034a2ffaea8fd452db2f80328ece297b35f341 100644 (file)
@@ -15,7 +15,7 @@
 // will tell you what you need to do.
 //
 // The commands in here will all be database-neutral,
-// using the functions defined in lib/ddllib.php
+// using the methods of database_manager class
 
 function xmldb_enrol_authorize_upgrade($oldversion=0) {
 
index 2fd5c4308ad6ac4f58287f4fbf830a9090cf84ba..7c39348e9a011be8f7d87fc38181d2bf8f9def95 100644 (file)
@@ -15,7 +15,7 @@
 // will tell you what you need to do.
 //
 // The commands in here will all be database-neutral,
-// using the functions defined in lib/ddllib.php
+// using the methods of database_manager class
 
 function xmldb_enrol_paypal_upgrade($oldversion=0) {
 
@@ -29,7 +29,7 @@ function xmldb_enrol_paypal_upgrade($oldversion=0) {
 /// upgrade code.
 
 /// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
-///     $result = result of "/lib/ddllib.php" function calls
+///     $result = result of database_manager methods
 /// }
 
     return $result;
index ccd0ef378f119221948c82f8bbefba63a238e95e..e72cc410218ed9040cf56370a13102652b198da1 100755 (executable)
@@ -5125,7 +5125,6 @@ function component_level_changed($cap, $comp, $contextlevel) {
  */
 function build_context_path($force=false) {
     global $CFG, $DB;
-    require_once($CFG->libdir.'/ddllib.php');
 
     // System context
     $sitectx = get_system_context(!$force);
index 6c4d2f7ba3489d41b2e7b664c28ff623f16037c9..3cae116116e198913b44d4c38b5338d7fdcac0da 100644 (file)
@@ -9,6 +9,22 @@
  * @package moodlecore
  */
 
+/// Add required XMLDB constants
+require_once($CFG->libdir.'/xmldb/xmldb_constants.php');
+
+/// Add required XMLDB DB classes
+require_once($CFG->libdir.'/xmldb/xmldb_object.php');
+require_once($CFG->libdir.'/xmldb/xmldb_file.php');
+require_once($CFG->libdir.'/xmldb/xmldb_structure.php');
+require_once($CFG->libdir.'/xmldb/xmldb_table.php');
+require_once($CFG->libdir.'/xmldb/xmldb_field.php');
+require_once($CFG->libdir.'/xmldb/xmldb_key.php');
+require_once($CFG->libdir.'/xmldb/xmldb_index.php');
+require_once($CFG->libdir.'/xmldb/xmldb_statement.php');
+
+/// Add other libraries
+require_once($CFG->libdir.'/xmlize.php');
+
 function upgrade_main_savepoint($result, $version) {
     global $CFG;
 
@@ -39,6 +55,146 @@ function upgrade_blocks_savepoint($result, $version, $type) {
     //TODO
 }
 
+/**
+ * Delete all plugin tables
+ * @name string name of plugin, used as table prefix
+ * @file string path to install.xml file
+ * @feedback boolean
+ */
+function drop_plugin_tables($name, $file, $feedback=true) {
+    global $CFG, $DB;
+
+    // first try normal delete
+    if ($DB->get_manager()->delete_tables_from_xmldb_file($file, $feedback)) {
+        return true;
+    }
+
+    // then try to find all tables that start with name and are not in any xml file
+    $used_tables = get_used_table_names();
+
+    $tables = $DB->get_tables();
+
+    /// Iterate over, fixing id fields as necessary
+    foreach ($tables as $table) {
+        if (in_array($table, $used_tables)) {
+            continue;
+        }
+
+        // found orphan table --> delete it
+        if ($DB->get_manager()->table_exists($table)) {
+            $xmldb_table = new xmldb_table($table);
+            $DB->get_manager()->drop_table($xmldb_table, true, $feedback);
+        }
+    }
+
+    return true;
+}
+
+/**
+ * Returns names of all known tables == tables that moodle knowns about.
+ * @return array of lowercase table names
+ */
+function get_used_table_names() {
+    $table_names = array();
+    $dbdirs = get_db_directories();
+
+    foreach ($dbdirs as $dbdir) {
+        $file = $dbdir.'/install.xml';
+
+        $xmldb_file = new xmldb_file($file);
+
+        if (!$xmldb_file->fileExists()) {
+            continue;
+        }
+
+        $loaded    = $xmldb_file->loadXMLStructure();
+        $structure =& $xmldb_file->getStructure();
+
+        if ($loaded and $tables = $structure->getTables()) {
+            foreach($tables as $table) {
+                $table_names[] = strtolower($table->name);
+            }
+        }
+    }
+
+    return $table_names;
+}
+
+/**
+ * Returns list of all directories where we expect install.xml files
+ * @return array of paths
+ */
+function get_db_directories() {
+    global $CFG;
+
+    $dbdirs = array();
+
+/// First, the main one (lib/db)
+    $dbdirs[] = $CFG->libdir.'/db';
+
+/// Now, activity modules (mod/xxx/db)
+    if ($plugins = get_list_of_plugins('mod')) {
+        foreach ($plugins as $plugin) {
+            $dbdirs[] = $CFG->dirroot.'/mod/'.$plugin.'/db';
+        }
+    }
+
+/// Now, assignment submodules (mod/assignment/type/xxx/db)
+    if ($plugins = get_list_of_plugins('mod/assignment/type')) {
+        foreach ($plugins as $plugin) {
+            $dbdirs[] = $CFG->dirroot.'/mod/assignment/type/'.$plugin.'/db';
+        }
+    }
+
+/// Now, question types (question/type/xxx/db)
+    if ($plugins = get_list_of_plugins('question/type')) {
+        foreach ($plugins as $plugin) {
+            $dbdirs[] = $CFG->dirroot.'/question/type/'.$plugin.'/db';
+        }
+    }
+
+/// Now, backup/restore stuff (backup/db)
+    $dbdirs[] = $CFG->dirroot.'/backup/db';
+
+/// Now, block system stuff (blocks/db)
+    $dbdirs[] = $CFG->dirroot.'/blocks/db';
+
+/// Now, blocks (blocks/xxx/db)
+    if ($plugins = get_list_of_plugins('blocks', 'db')) {
+        foreach ($plugins as $plugin) {
+            $dbdirs[] = $CFG->dirroot.'/blocks/'.$plugin.'/db';
+        }
+    }
+
+/// Now, course formats (course/format/xxx/db)
+    if ($plugins = get_list_of_plugins('course/format', 'db')) {
+        foreach ($plugins as $plugin) {
+            $dbdirs[] = $CFG->dirroot.'/course/format/'.$plugin.'/db';
+        }
+    }
+
+/// Now, enrolment plugins (enrol/xxx/db)
+    if ($plugins = get_list_of_plugins('enrol', 'db')) {
+        foreach ($plugins as $plugin) {
+            $dbdirs[] = $CFG->dirroot.'/enrol/'.$plugin.'/db';
+        }
+    }
+
+/// Now admin report plugins (admin/report/xxx/db)
+    if ($plugins = get_list_of_plugins($CFG->admin.'/report', 'db')) {
+        foreach ($plugins as $plugin) {
+            $dbdirs[] = $CFG->dirroot.'/'.$CFG->admin.'/report/'.$plugin.'/db';
+        }
+    }
+
+/// Local database changes, if the local folder exists.
+    if (file_exists($CFG->dirroot . '/local')) {
+        $dbdirs[] = $CFG->dirroot.'/local/db';
+    }
+
+    return $dbdirs;
+}
+
 /**
  * Upgrade plugins
  *
index 52c1e3f1618f700e462d8f3023ba7f50adcb1657..ab98e01da672a3a1c0e49b841cf524479bd40d3a 100644 (file)
@@ -14,7 +14,7 @@
 // will tell you what you need to do.
 //
 // The commands in here will all be database-neutral,
-// using the functions defined in lib/ddllib.php
+// using the methods of database_manager class
 
 
 function xmldb_main_upgrade($oldversion=0) {
index b9ded9841a1e744438b0ebdbf20745f7649e57d6..a4a631a0a8487aa6807f4a3f423c335b72c823ae 100644 (file)
@@ -60,7 +60,6 @@ class database_manager {
     /**
      * This function will execute an array of SQL commands, returning
      * true/false if any error is found and stopping/continue as desired.
-     * It's widely used by all the ddllib.php functions
      *
      * @param array $sqlarr array of sql statements to execute
      * @param boolean $continue to specify if must continue on error (true) or stop (false)
index f6b995d5dbfdc0672c277abbbe70bd66f72a7e68..c892ad96af945a946b3cd869b5d1afe34221dabf 100644 (file)
@@ -220,7 +220,7 @@ class mssql_sql_generator extends sql_generator {
 
         $results = array();  //Array where all the sentences will be stored
 
-    /// Although this is checked in ddllib - rename_field() - double check
+    /// Although this is checked in database_manager::rename_field() - double check
     /// that we aren't trying to rename one "id" field. Although it could be
     /// implemented (if adding the necessary code to rename sequences, defaults,
     /// triggers... and so on under each getRenameFieldExtraSQL() function, it's
index 65035f72babb512916292cc485b5a9d2d0bd6bd7..0002f101a91db6af78ceb358d52a3414ac7cf514 100755 (executable)
@@ -9,7 +9,7 @@ if (!defined('MOODLE_INTERNAL')) {
     die('Direct access to this script is forbidden.');    ///  It must be included from a Moodle page
 }
 
-require_once($CFG->libdir . '/ddllib.php');
+require_once($CFG->libdir . '/adminlib.php');
 
 class ddllib_test extends UnitTestCase {
     private $tables = array();
index c6881ea1e9e139c46cc82069a994e97f33f52447..3608f57db5575183b5844b115ab2df18cfd18a8e 100644 (file)
@@ -767,7 +767,7 @@ abstract class sql_generator {
 
         $results = array();  //Array where all the sentences will be stored
 
-    /// Although this is checked in ddllib - rename_field() - double check
+    /// Although this is checked in database_manager::rename_field() - double check
     /// that we aren't trying to rename one "id" field. Although it could be
     /// implemented (if adding the necessary code to rename sequences, defaults,
     /// triggers... and so on under each getRenameFieldExtraSQL() function, it's
index cfaa4505e0c9f5ceb95618bff056358846b881be..28039cbe0c5571d3b0838098ba4d9dc9c5ae1d02 100644 (file)
 //
 // For further documentation, visit http://docs.moodle.org/en/DDL_functions
 
-/// Add required XMLDB constants
-require_once($CFG->libdir.'/xmldb/xmldb_constants.php');
-
-/// Add required XMLDB DB classes
-require_once($CFG->libdir.'/xmldb/xmldb_object.php');
-require_once($CFG->libdir.'/xmldb/xmldb_file.php');
-require_once($CFG->libdir.'/xmldb/xmldb_structure.php');
-require_once($CFG->libdir.'/xmldb/xmldb_table.php');
-require_once($CFG->libdir.'/xmldb/xmldb_field.php');
-require_once($CFG->libdir.'/xmldb/xmldb_key.php');
-require_once($CFG->libdir.'/xmldb/xmldb_index.php');
-require_once($CFG->libdir.'/xmldb/xmldb_statement.php');
-
-/// Add other libraries
-require_once($CFG->libdir.'/xmlize.php');
-
-/**
- * Delete all plugin tables
- * @name string name of plugin, used as table prefix
- * @file string path to install.xml file
- * @feedback boolean
- */
-function drop_plugin_tables($name, $file, $feedback=true) {
-    global $CFG, $DB;
-
-    // first try normal delete
-    if ($DB->get_manager()->delete_tables_from_xmldb_file($file, $feedback)) {
-        return true;
-    }
-
-    // then try to find all tables that start with name and are not in any xml file
-    $used_tables = get_used_table_names();
-
-    $tables = $DB->get_tables();
-
-    /// Iterate over, fixing id fields as necessary
-    foreach ($tables as $table) {
-        if (in_array($table, $used_tables)) {
-            continue;
-        }
-
-        // found orphan table --> delete it
-        if ($DB->get_manager()->table_exists($table)) {
-            $xmldb_table = new xmldb_table($table);
-            $DB->get_manager()->drop_table($xmldb_table, true, $feedback);
-        }
-    }
-
-    return true;
-}
-
-/**
- * Returns names of all known tables == tables that moodle knowns about.
- * @return array of lowercase table names
- */
-function get_used_table_names() {
-    $table_names = array();
-    $dbdirs = get_db_directories();
-
-    foreach ($dbdirs as $dbdir) {
-        $file = $dbdir.'/install.xml';
-
-        $xmldb_file = new xmldb_file($file);
-
-        if (!$xmldb_file->fileExists()) {
-            continue;
-        }
-
-        $loaded    = $xmldb_file->loadXMLStructure();
-        $structure =& $xmldb_file->getStructure();
-
-        if ($loaded and $tables = $structure->getTables()) {
-            foreach($tables as $table) {
-                $table_names[] = strtolower($table->name);
-            }
-        }
-    }
-
-    return $table_names;
-}
-
-/**
- * Returns list of all directories where we expect install.xml files
- * @return array of paths
- */
-function get_db_directories() {
-    global $CFG;
-
-    $dbdirs = array();
-
-/// First, the main one (lib/db)
-    $dbdirs[] = $CFG->libdir.'/db';
-
-/// Now, activity modules (mod/xxx/db)
-    if ($plugins = get_list_of_plugins('mod')) {
-        foreach ($plugins as $plugin) {
-            $dbdirs[] = $CFG->dirroot.'/mod/'.$plugin.'/db';
-        }
-    }
-
-/// Now, assignment submodules (mod/assignment/type/xxx/db)
-    if ($plugins = get_list_of_plugins('mod/assignment/type')) {
-        foreach ($plugins as $plugin) {
-            $dbdirs[] = $CFG->dirroot.'/mod/assignment/type/'.$plugin.'/db';
-        }
-    }
-
-/// Now, question types (question/type/xxx/db)
-    if ($plugins = get_list_of_plugins('question/type')) {
-        foreach ($plugins as $plugin) {
-            $dbdirs[] = $CFG->dirroot.'/question/type/'.$plugin.'/db';
-        }
-    }
-
-/// Now, backup/restore stuff (backup/db)
-    $dbdirs[] = $CFG->dirroot.'/backup/db';
-
-/// Now, block system stuff (blocks/db)
-    $dbdirs[] = $CFG->dirroot.'/blocks/db';
-
-/// Now, blocks (blocks/xxx/db)
-    if ($plugins = get_list_of_plugins('blocks', 'db')) {
-        foreach ($plugins as $plugin) {
-            $dbdirs[] = $CFG->dirroot.'/blocks/'.$plugin.'/db';
-        }
-    }
-
-/// Now, course formats (course/format/xxx/db)
-    if ($plugins = get_list_of_plugins('course/format', 'db')) {
-        foreach ($plugins as $plugin) {
-            $dbdirs[] = $CFG->dirroot.'/course/format/'.$plugin.'/db';
-        }
-    }
-
-/// Now, enrolment plugins (enrol/xxx/db)
-    if ($plugins = get_list_of_plugins('enrol', 'db')) {
-        foreach ($plugins as $plugin) {
-            $dbdirs[] = $CFG->dirroot.'/enrol/'.$plugin.'/db';
-        }
-    }
-
-/// Now admin report plugins (admin/report/xxx/db)
-    if ($plugins = get_list_of_plugins($CFG->admin.'/report', 'db')) {
-        foreach ($plugins as $plugin) {
-            $dbdirs[] = $CFG->dirroot.'/'.$CFG->admin.'/report/'.$plugin.'/db';
-        }
-    }
-
-/// Local database changes, if the local folder exists.
-    if (file_exists($CFG->dirroot . '/local')) {
-        $dbdirs[] = $CFG->dirroot.'/local/db';
-    }
-
-    return $dbdirs;
-}
-
-
 // DEPRECATED - to be removed soon
 
-function table_exists($table) {
-    global $DB;
-    debugging('Deprecated ddllib function used!');
-    return $DB->get_manager()->table_exists($table);
-}
-
-function field_exists($table, $field) {
-    global $DB;
-    debugging('Deprecated ddllib function used!');
-    return $DB->get_manager()->field_exists($table, $field);
-}
-
-function find_index_name($table, $index) {
-    global $DB;
-    debugging('Deprecated ddllib function used!');
-    return $DB->get_manager()->find_index_name($table, $index);
-}
-
-function index_exists($table, $index) {
-    global $DB;
-    debugging('Deprecated ddllib function used!');
-    return $DB->get_manager()->index_exists($table, $index);
-}
-
-function find_check_constraint_name($table, $field) {
-    global $DB;
-    debugging('Deprecated ddllib function used!');
-    return $DB->get_manager()->find_check_constraint_name($table, $field);
-}
-
-function check_constraint_exists($table, $field) {
-    global $DB;
-    debugging('Deprecated ddllib function used!');
-    return $DB->get_manager()->check_constraint_exists($table, $field);
-}
-
-function find_key_name($table, $xmldb_key) {
-    global $DB;
-    debugging('Deprecated ddllib function used!');
-    return $DB->get_manager()->find_key_name($table, $xmldb_key);
-}
-
-function find_sequence_name($table) {
-    global $DB;
-    debugging('Deprecated ddllib function used!');
-    return $DB->get_manager()->find_sequence_name($table);
-}
-
-function drop_table($table, $continue=true, $feedback=true) {
-    global $DB;
-    debugging('Deprecated ddllib function used!');
-    return $DB->get_manager()->drop_table($table, $continue, $feedback);
-}
-
-function install_from_xmldb_file($file) {
-    global $DB;
-    debugging('Deprecated ddllib function used!');
-    return $DB->get_manager()->install_from_xmldb_file($file);
-}
-
-function create_table($table, $continue=true, $feedback=true) {
-    global $DB;
-    debugging('Deprecated ddllib function used!');
-    return $DB->get_manager()->create_table($table, $continue, $feedback);
-}
-
-function create_temp_table($table, $continue=true, $feedback=true) {
-    global $DB;
-    debugging('Deprecated ddllib function used!');
-    return $DB->get_manager()->create_temp_table($table, $continue, $feedback);
-}
-
-function rename_table($table, $newname, $continue=true, $feedback=true) {
-    global $DB;
-    debugging('Deprecated ddllib function used!');
-    return $DB->get_manager()->rename_table($table, $newname, $continue, $feedback);
-}
-
-function add_field($table, $field, $continue=true, $feedback=true) {
-    global $DB;
-    debugging('Deprecated ddllib function used!');
-    return $DB->get_manager()->add_field($table, $field, $continue, $feedback);
-}
-
-function drop_field($table, $field, $continue=true, $feedback=true) {
-    global $DB;
-    debugging('Deprecated ddllib function used!');
-    return $DB->get_manager()->drop_field($table, $field, $continue, $feedback);
-}
-
-function change_field_type($table, $field, $continue=true, $feedback=true) {
-    global $DB;
-    debugging('Deprecated ddllib function used!');
-    return $DB->get_manager()->change_field_type($table, $field, $continue, $feedback);
-}
-
-function change_field_precision($table, $field, $continue=true, $feedback=true) {
-    global $DB;
-    debugging('Deprecated ddllib function used!');
-    return $DB->get_manager()->change_field_precision($table, $field, $continue, $feedback);
-}
-
-function change_field_unsigned($table, $field, $continue=true, $feedback=true) {
-    global $DB;
-    debugging('Deprecated ddllib function used!');
-    return $DB->get_manager()->change_field_unsigned($table, $field, $continue, $feedback);
-}
-
-function change_field_notnull($table, $field, $continue=true, $feedback=true) {
-    global $DB;
-    debugging('Deprecated ddllib function used!');
-    return $DB->get_manager()->change_field_notnull($table, $field, $continue, $feedback);
-}
-
-function change_field_enum($table, $field, $continue=true, $feedback=true) {
-    global $DB;
-    debugging('Deprecated ddllib function used!');
-    return $DB->get_manager()->change_field_enum($table, $field, $continue, $feedback);
-}
-
-function change_field_default($table, $field, $continue=true, $feedback=true) {
-    global $DB;
-    debugging('Deprecated ddllib function used!');
-    return $DB->get_manager()->change_field_default($table, $field, $continue, $feedback);
-}
-
-function rename_field($table, $field, $newname, $continue=true, $feedback=true) {
-    global $DB;
-    debugging('Deprecated ddllib function used!');
-    return $DB->get_manager()->rename_field($table, $field, $continue, $feedback);
-}
-
-function add_key($table, $key, $continue=true, $feedback=true) {
-    global $DB;
-    debugging('Deprecated ddllib function used!');
-    return $DB->get_manager()->add_key($table, $key, $continue, $feedback);
-}
-
-function drop_key($table, $key, $continue=true, $feedback=true) {
-    global $DB;
-    debugging('Deprecated ddllib function used!');
-    return $DB->get_manager()->drop_key($table, $key, $continue, $feedback);
-}
-
-function rename_key($table, $key, $newname, $continue=true, $feedback=true) {
-    global $DB;
-    debugging('Deprecated ddllib function used!');
-    return $DB->get_manager()->rename_key($table, $key, $newname, $continue, $feedback);
-}
-
-function add_index($table, $index, $continue=true, $feedback=true) {
-    global $DB;
-    debugging('Deprecated ddllib function used!');
-    return $DB->get_manager()->add_index($table, $index, $continue, $feedback);
-}
-
-function drop_index($table, $index, $continue=true, $feedback=true) {
-    global $DB;
-    debugging('Deprecated ddllib function used!');
-    return $DB->get_manager()->drop_index($table, $index, $continue, $feedback);
-}
-
-function rename_index($table, $index, $newname, $continue=true, $feedback=true) {
-    global $DB;
-    debugging('Deprecated ddllib function used!');
-    return $DB->get_manager()->rename_index($table, $index, $newname, $continue, $feedback);
-}
-
 
 ?>
index eeb36b281d410e3ba797ed3f1656b31a12d153e3..787944384a1c52c100ea9ddb2bc80f368d7aa304 100644 (file)
@@ -446,6 +446,176 @@ function error($message, $link='') {
 }
 
 
+/// Deprecated DDL functions, to be removed soon ///
+
+function table_exists($table) {
+    global $DB;
+    debugging('Deprecated ddllib function used!');
+    return $DB->get_manager()->table_exists($table);
+}
+
+function field_exists($table, $field) {
+    global $DB;
+    debugging('Deprecated ddllib function used!');
+    return $DB->get_manager()->field_exists($table, $field);
+}
+
+function find_index_name($table, $index) {
+    global $DB;
+    debugging('Deprecated ddllib function used!');
+    return $DB->get_manager()->find_index_name($table, $index);
+}
+
+function index_exists($table, $index) {
+    global $DB;
+    debugging('Deprecated ddllib function used!');
+    return $DB->get_manager()->index_exists($table, $index);
+}
+
+function find_check_constraint_name($table, $field) {
+    global $DB;
+    debugging('Deprecated ddllib function used!');
+    return $DB->get_manager()->find_check_constraint_name($table, $field);
+}
+
+function check_constraint_exists($table, $field) {
+    global $DB;
+    debugging('Deprecated ddllib function used!');
+    return $DB->get_manager()->check_constraint_exists($table, $field);
+}
+
+function find_key_name($table, $xmldb_key) {
+    global $DB;
+    debugging('Deprecated ddllib function used!');
+    return $DB->get_manager()->find_key_name($table, $xmldb_key);
+}
+
+function find_sequence_name($table) {
+    global $DB;
+    debugging('Deprecated ddllib function used!');
+    return $DB->get_manager()->find_sequence_name($table);
+}
+
+function drop_table($table, $continue=true, $feedback=true) {
+    global $DB;
+    debugging('Deprecated ddllib function used!');
+    return $DB->get_manager()->drop_table($table, $continue, $feedback);
+}
+
+function install_from_xmldb_file($file) {
+    global $DB;
+    debugging('Deprecated ddllib function used!');
+    return $DB->get_manager()->install_from_xmldb_file($file);
+}
+
+function create_table($table, $continue=true, $feedback=true) {
+    global $DB;
+    debugging('Deprecated ddllib function used!');
+    return $DB->get_manager()->create_table($table, $continue, $feedback);
+}
+
+function create_temp_table($table, $continue=true, $feedback=true) {
+    global $DB;
+    debugging('Deprecated ddllib function used!');
+    return $DB->get_manager()->create_temp_table($table, $continue, $feedback);
+}
+
+function rename_table($table, $newname, $continue=true, $feedback=true) {
+    global $DB;
+    debugging('Deprecated ddllib function used!');
+    return $DB->get_manager()->rename_table($table, $newname, $continue, $feedback);
+}
+
+function add_field($table, $field, $continue=true, $feedback=true) {
+    global $DB;
+    debugging('Deprecated ddllib function used!');
+    return $DB->get_manager()->add_field($table, $field, $continue, $feedback);
+}
+
+function drop_field($table, $field, $continue=true, $feedback=true) {
+    global $DB;
+    debugging('Deprecated ddllib function used!');
+    return $DB->get_manager()->drop_field($table, $field, $continue, $feedback);
+}
+
+function change_field_type($table, $field, $continue=true, $feedback=true) {
+    global $DB;
+    debugging('Deprecated ddllib function used!');
+    return $DB->get_manager()->change_field_type($table, $field, $continue, $feedback);
+}
+
+function change_field_precision($table, $field, $continue=true, $feedback=true) {
+    global $DB;
+    debugging('Deprecated ddllib function used!');
+    return $DB->get_manager()->change_field_precision($table, $field, $continue, $feedback);
+}
+
+function change_field_unsigned($table, $field, $continue=true, $feedback=true) {
+    global $DB;
+    debugging('Deprecated ddllib function used!');
+    return $DB->get_manager()->change_field_unsigned($table, $field, $continue, $feedback);
+}
+
+function change_field_notnull($table, $field, $continue=true, $feedback=true) {
+    global $DB;
+    debugging('Deprecated ddllib function used!');
+    return $DB->get_manager()->change_field_notnull($table, $field, $continue, $feedback);
+}
+
+function change_field_enum($table, $field, $continue=true, $feedback=true) {
+    global $DB;
+    debugging('Deprecated ddllib function used!');
+    return $DB->get_manager()->change_field_enum($table, $field, $continue, $feedback);
+}
+
+function change_field_default($table, $field, $continue=true, $feedback=true) {
+    global $DB;
+    debugging('Deprecated ddllib function used!');
+    return $DB->get_manager()->change_field_default($table, $field, $continue, $feedback);
+}
+
+function rename_field($table, $field, $newname, $continue=true, $feedback=true) {
+    global $DB;
+    debugging('Deprecated ddllib function used!');
+    return $DB->get_manager()->rename_field($table, $field, $continue, $feedback);
+}
+
+function add_key($table, $key, $continue=true, $feedback=true) {
+    global $DB;
+    debugging('Deprecated ddllib function used!');
+    return $DB->get_manager()->add_key($table, $key, $continue, $feedback);
+}
+
+function drop_key($table, $key, $continue=true, $feedback=true) {
+    global $DB;
+    debugging('Deprecated ddllib function used!');
+    return $DB->get_manager()->drop_key($table, $key, $continue, $feedback);
+}
+
+function rename_key($table, $key, $newname, $continue=true, $feedback=true) {
+    global $DB;
+    debugging('Deprecated ddllib function used!');
+    return $DB->get_manager()->rename_key($table, $key, $newname, $continue, $feedback);
+}
+
+function add_index($table, $index, $continue=true, $feedback=true) {
+    global $DB;
+    debugging('Deprecated ddllib function used!');
+    return $DB->get_manager()->add_index($table, $index, $continue, $feedback);
+}
+
+function drop_index($table, $index, $continue=true, $feedback=true) {
+    global $DB;
+    debugging('Deprecated ddllib function used!');
+    return $DB->get_manager()->drop_index($table, $index, $continue, $feedback);
+}
+
+function rename_index($table, $index, $newname, $continue=true, $feedback=true) {
+    global $DB;
+    debugging('Deprecated ddllib function used!');
+    return $DB->get_manager()->rename_index($table, $index, $newname, $continue, $feedback);
+}
+
 
 //////////////////////////
 /// removed functions ////
@@ -724,4 +894,4 @@ function table_column($table, $oldfield, $field, $type='integer', $size='10',
                       $signed='unsigned', $default='0', $null='not null', $after='') {
     error('table_column() was removed, please use new ddl functions');
 }
-    
\ No newline at end of file
+
index 27cbe34c367c8f271c542cbc9bd7e0b816161c32..ea277f583460c68ff73cbc6b8152f49bb78228fb 100644 (file)
@@ -381,7 +381,7 @@ abstract class moodle_database {
         global $CFG;
 
         if (!$this->database_manager) {
-            require_once($CFG->libdir.'/ddllib.php');
+            require_once($CFG->libdir.'/adminlib.php');
             require_once($CFG->libdir.'/ddl/database_manager.php');
 
             $classname = $this->get_dbfamily().'_sql_generator';
index 160190e3ef4ce9a709c9e2e48792ce4d8cd26e45..b0645054b39f3f3babd9c90f37032a1429769807 100644 (file)
@@ -34,9 +34,8 @@ if (!defined('MOODLE_INTERNAL')) {
  * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
  * @package moodlecore
  */
+require_once($CFG->libdir . '/adminlib.php');
 require_once($CFG->libdir . '/gradelib.php');
-require_once($CFG->libdir . '/dmllib.php');
-require_once($CFG->libdir . '/ddllib.php');
 
 Mock::generate('grade_item', 'mock_grade_item');
 Mock::generate('grade_scale', 'mock_grade_scale');
index 3af92c8b775779181bde78a5ea2143f7a8849391..ef11ef6e72c0743f2a64867f068c05062708a9c1 100644 (file)
@@ -15,7 +15,7 @@
 // will tell you what you need to do.
 //
 // The commands in here will all be database-neutral,
-// using the functions defined in lib/ddllib.php
+// using the methods of database_manager class
 
 function xmldb_assignment_upgrade($oldversion=0) {
 
index cb7cebaff94cdc37c95007fd65c9d8b45964e973..f2876317fda70d8b9c96a81c725fb4fe21dd149f 100644 (file)
@@ -15,7 +15,7 @@
 // will tell you what you need to do.
 //
 // The commands in here will all be database-neutral,
-// using the functions defined in lib/ddllib.php
+// using the methods of database_manager class
 
 function xmldb_chat_upgrade($oldversion=0) {
 
index 5545b6d6de9ad3d7f932c817f72fe926e7dd7f76..b8e04bc27b4bfb94a6791c678cb8c80394d64e06 100644 (file)
@@ -15,7 +15,7 @@
 // will tell you what you need to do.
 //
 // The commands in here will all be database-neutral,
-// using the functions defined in lib/ddllib.php
+// using the methods of database_manager class
 
 function xmldb_choice_upgrade($oldversion=0) {
 
@@ -29,7 +29,7 @@ function xmldb_choice_upgrade($oldversion=0) {
 /// upgrade code.
 
 /// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
-///     $result = result of "/lib/ddllib.php" function calls
+///     $result = result of database_manager methods
 /// }
 
 //===== 1.9.0 upgrade line ======//
index f82f8d79714c88883fda2742fcdbcf84e0fef5df..94627617a16039bd746d4a2fffa1db13957e1040 100644 (file)
@@ -15,7 +15,7 @@
 // will tell you what you need to do.
 //
 // The commands in here will all be database-neutral,
-// using the functions defined in lib/ddllib.php
+// using the methods of database_manager class
 
 function xmldb_data_upgrade($oldversion=0) {
 
index 5dffd1047af2ee225d9d151a0c789a95b44a609c..6b9c847b0f8417a65b2fb112bea3ac14c6fc3ca0 100644 (file)
@@ -15,7 +15,7 @@
 // will tell you what you need to do.
 //
 // The commands in here will all be database-neutral,
-// using the functions defined in lib/ddllib.php
+// using the methods of database_manager class
 
 function xmldb_feedback_upgrade($oldversion=0) {
 
index ae0c755135809ba009e4a1ab0be2667f520eba47..acd4cea3821b36db4b5db87856b2fbfa5fb45851 100644 (file)
@@ -15,7 +15,7 @@
 // will tell you what you need to do.
 //
 // The commands in here will all be database-neutral,
-// using the functions defined in lib/ddllib.php
+// using the methods of database_manager class
 
 function xmldb_forum_upgrade($oldversion=0) {
 
@@ -29,7 +29,7 @@ function xmldb_forum_upgrade($oldversion=0) {
 /// upgrade code.
 
 /// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
-///     $result = result of "/lib/ddllib.php" function calls
+///     $result = result of database_manager methods
 /// }
 
 //===== 1.9.0 upgrade line ======//
index 4645ef457db344f326161dc265db51bd1dfac3d7..ca1a3991231e89cfbfd81e654c0d5422c7ea7421 100644 (file)
@@ -15,7 +15,7 @@
 // will tell you what you need to do.
 //
 // The commands in here will all be database-neutral,
-// using the functions defined in lib/ddllib.php
+// using the methods of database_manager class
 
 function xmldb_glossary_upgrade($oldversion=0) {
 
@@ -29,7 +29,7 @@ function xmldb_glossary_upgrade($oldversion=0) {
 /// upgrade code.
 
 /// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
-///     $result = result of "/lib/ddllib.php" function calls
+///     $result = result of database_manager methods
 /// }
     
 //===== 1.9.0 upgrade line ======//
index 4b7e6b53009df5753d7feb6cee749cf585e52fbe..bfa9812af9a90b5660b71e545517f2ffc8c7a418 100644 (file)
@@ -15,7 +15,7 @@
 // will tell you what you need to do.
 //
 // The commands in here will all be database-neutral,
-// using the functions defined in lib/ddllib.php
+// using the methods of database_manager class
 
 function xmldb_label_upgrade($oldversion=0) {
     global $CFG, $THEME, $DB;
@@ -28,7 +28,7 @@ function xmldb_label_upgrade($oldversion=0) {
 /// upgrade code.
 
 /// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
-///     $result = result of "/lib/ddllib.php" function calls
+///     $result = result of database_manager methods
 /// }
 
 //===== 1.9.0 upgrade line ======//
index 92cbc0a2c92d115fb89195aefae4307a97e565de..365e22509310658287900152907dbe0973fa31e8 100644 (file)
@@ -15,7 +15,7 @@
 // will tell you what you need to do.
 //
 // The commands in here will all be database-neutral,
-// using the functions defined in lib/ddllib.php
+// using the methods of database_manager class
 
 function xmldb_lesson_upgrade($oldversion=0) {
 
index 795e99fdbe4d606b3c2fc3f7404f0abd96085510..0c060d9ff0956829f8a6f396dba514ca666db423 100644 (file)
@@ -15,7 +15,7 @@
 // will tell you what you need to do.
 //
 // The commands in here will all be database-neutral,
-// using the functions defined in lib/ddllib.php
+// using the methods of database_manager class
 
 function xmldb_quiz_upgrade($oldversion=0) {
 
index 93c376fecd57e7bbe91c5fa563d6f9c9b5af177d..893d862efcd147958f9b456169b10bdb9a452b19 100644 (file)
@@ -15,7 +15,7 @@
 // will tell you what you need to do.
 //
 // The commands in here will all be database-neutral,
-// using the functions defined in lib/ddllib.php
+// using the methods of database_manager class
 
 function xmldb_resource_upgrade($oldversion=0) {
     global $CFG, $THEME, $DB;
@@ -28,7 +28,7 @@ function xmldb_resource_upgrade($oldversion=0) {
 /// upgrade code.
 
 /// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
-///     $result = result of "/lib/ddllib.php" function calls
+///     $result = result of database_manager methods
 /// }
 
 //===== 1.9.0 upgrade line ======//
index 512cfcf45abb7af1af39e2884d5306bf2914c677..e27bd650fd208f6f5227bb6ace8c7f383e93a16a 100644 (file)
@@ -15,7 +15,7 @@
 // will tell you what you need to do.
 //
 // The commands in here will all be database-neutral,
-// using the functions defined in lib/ddllib.php
+// using the methods of database_manager class
 
 function xmldb_scorm_upgrade($oldversion=0) {
 
index 9c652cf734fbd60b89356337329b0904add84653..cb26e843180336555d39fd52b562f711882e634f 100644 (file)
@@ -15,7 +15,7 @@
 // will tell you what you need to do.
 //
 // The commands in here will all be database-neutral,
-// using the functions defined in lib/ddllib.php
+// using the methods of database_manager class
 
 function xmldb_survey_upgrade($oldversion=0) {
 
@@ -29,7 +29,7 @@ function xmldb_survey_upgrade($oldversion=0) {
 /// upgrade code.
 
 /// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
-///     $result = result of "/lib/ddllib.php" function calls
+///     $result = result of database_manager methods
 /// }
 
 //===== 1.9.0 upgrade line ======//
index b2686a947ee9a0708cf6f21abf448d9ff6391d59..24806e82c99861d4d41aa300f169c76951a31c84 100644 (file)
@@ -15,7 +15,7 @@
 // will tell you what you need to do.
 //
 // The commands in here will all be database-neutral,
-// using the functions defined in lib/ddllib.php
+// using the methods of database_manager class
 
 function xmldb_wiki_upgrade($oldversion=0) {
 
@@ -29,7 +29,7 @@ function xmldb_wiki_upgrade($oldversion=0) {
 /// upgrade code.
 
 /// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
-///     $result = result of "/lib/ddllib.php" function calls
+///     $result = result of database_manager methods
 /// }
 
 //===== 1.9.0 upgrade line ======//
index 8cb1fe8611acf414cb093165ff86eec76a822b7e..05c6c2823d9651b5585b9caedcc4611c26fe0781 100644 (file)
@@ -15,7 +15,7 @@
 // will tell you what you need to do.
 //
 // The commands in here will all be database-neutral,
-// using the functions defined in lib/ddllib.php
+// using the methods of database_manager class
 
 function xmldb_qtype_calculated_upgrade($oldversion=0) {
 
@@ -29,7 +29,7 @@ function xmldb_qtype_calculated_upgrade($oldversion=0) {
 /// upgrade code.
 
 /// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
-///     $result = result of "/lib/ddllib.php" function calls
+///     $result = result of database_manager methods
 /// }
 
     return $result;
index bdf553fb5eca98a67f9f9be460463fe33d546334..b98d8fb5a503c5b1702fed24dd3c1ee408dbf3e1 100644 (file)
@@ -15,7 +15,7 @@
 // will tell you what you need to do.
 //
 // The commands in here will all be database-neutral,
-// using the functions defined in lib/ddllib.php
+// using the methods of database_manager class
 
 function xmldb_qtype_essay_upgrade($oldversion=0) {
 
@@ -29,7 +29,7 @@ function xmldb_qtype_essay_upgrade($oldversion=0) {
 /// upgrade code.
 
 /// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
-///     $result = result of "/lib/ddllib.php" function calls
+///     $result = result of database_manager methods
 /// }
 
     return $result;
index d18ea5fcfe5601625e07333932dcca62109b0869..16d352b3a45aa10fe4fdf1a6acdbe1341b160fb3 100644 (file)
@@ -15,7 +15,7 @@
 // will tell you what you need to do.
 //
 // The commands in here will all be database-neutral,
-// using the functions defined in lib/ddllib.php
+// using the methods of database_manager class
 
 function xmldb_qtype_match_upgrade($oldversion=0) {
 
@@ -29,7 +29,7 @@ function xmldb_qtype_match_upgrade($oldversion=0) {
 /// upgrade code.
 
 /// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
-///     $result = result of "/lib/ddllib.php" function calls
+///     $result = result of database_manager methods
 /// }
 
     return $result;
index d3b38892d26cab7d24229b13876b1c999b16224f..e1d5b2ffaa2222d0a1c3e8d50a828af8a848384f 100644 (file)
@@ -15,7 +15,7 @@
 // will tell you what you need to do.
 //
 // The commands in here will all be database-neutral,
-// using the functions defined in lib/ddllib.php
+// using the methods of database_manager class
 
 function xmldb_qtype_multianswer_upgrade($oldversion=0) {
 
@@ -29,7 +29,7 @@ function xmldb_qtype_multianswer_upgrade($oldversion=0) {
 /// upgrade code.
 
 /// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
-///     $result = result of "/lib/ddllib.php" function calls
+///     $result = result of database_manager methods
 /// }
 
     if ($result && $oldversion < 2008050800) {
index ec2c5ed8fc67fc6c193ac047caebce46fb111014..c2ec89247d77165073eb7387a34285a5e54fe29a 100644 (file)
@@ -15,7 +15,7 @@
 // will tell you what you need to do.
 //
 // The commands in here will all be database-neutral,
-// using the functions defined in lib/ddllib.php
+// using the methods of database_manager class
 
 function xmldb_qtype_multichoice_upgrade($oldversion=0) {
 
index eea9e9a954fc07ec1f7bb59b7bbed2a37fd2dc2d..75d80651adf7fcb7e38a29d636e65d27060045a8 100644 (file)
@@ -15,7 +15,7 @@
 // will tell you what you need to do.
 //
 // The commands in here will all be database-neutral,
-// using the functions defined in lib/ddllib.php
+// using the methods of database_manager class
 
 function xmldb_qtype_numerical_upgrade($oldversion=0) {
 
index 8c315e147531eaa35c0e3751f2037f6ea4edb5e3..02ac7a2b36bff8f884b96a9689d531eb24745fff 100644 (file)
@@ -15,7 +15,7 @@
 // will tell you what you need to do.
 //
 // The commands in here will all be database-neutral,
-// using the functions defined in lib/ddllib.php
+// using the methods of database_manager class
 
 function xmldb_qtype_randomsamatch_upgrade($oldversion=0) {
 
@@ -29,7 +29,7 @@ function xmldb_qtype_randomsamatch_upgrade($oldversion=0) {
 /// upgrade code.
 
 /// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
-///     $result = result of "/lib/ddllib.php" function calls
+///     $result = result of database_manager methods
 /// }
 
     return $result;
index f245002805be1ecfc94bddfd6abb7d0c306e12ca..d38673d9ce86b975e05853dcf37a8932d312dd88 100644 (file)
@@ -15,7 +15,7 @@
 // will tell you what you need to do.
 //
 // The commands in here will all be database-neutral,
-// using the functions defined in lib/ddllib.php
+// using the methods of database_manager class
 
 function xmldb_qtype_shortanswer_upgrade($oldversion=0) {
 
@@ -29,7 +29,7 @@ function xmldb_qtype_shortanswer_upgrade($oldversion=0) {
 /// upgrade code.
 
 /// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
-///     $result = result of "/lib/ddllib.php" function calls
+///     $result = result of database_manager methods
 /// }
 
     return $result;
index 2c71db48b7a3d9c22e1bfafad708c23223900c5d..c10321a9bb3ba6981814c7b027e57419233e6a9c 100644 (file)
@@ -15,7 +15,7 @@
 // will tell you what you need to do.
 //
 // The commands in here will all be database-neutral,
-// using the functions defined in lib/ddllib.php
+// using the methods of database_manager class
 
 function xmldb_qtype_truefalse_upgrade($oldversion=0) {
 
@@ -29,7 +29,7 @@ function xmldb_qtype_truefalse_upgrade($oldversion=0) {
 /// upgrade code.
 
 /// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
-///     $result = result of "/lib/ddllib.php" function calls
+///     $result = result of database_manager methods
 /// }
 
     return $result;