]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-14679 fixed some more $db's
authorskodak <skodak>
Sat, 31 May 2008 22:18:41 +0000 (22:18 +0000)
committerskodak <skodak>
Sat, 31 May 2008 22:18:41 +0000 (22:18 +0000)
18 files changed:
admin/xmldb/actions/check_bigints/check_bigints.class.php
backup/restorelib.php
enrol/database/enrol.php
lib/datalib.php
lib/environmentlib.php
lib/locallib.php
mnet/xmlrpc/server.php
mod/assignment/lib.php
mod/data/import.php
mod/data/restorelib.php
mod/forum/lib.php
mod/forum/restorelib.php
mod/hotpot/lib.php
mod/quiz/report/overview/report.php
mod/survey/lib.php
mod/survey/restorelib.php
mod/wiki/ewiki/plugins/init.php
search/indexlib.php

index 6cc2b220f6e0a6b32e75553f899e0721001d4787..8553d61b4968a489bdb8ed7569872bc533e7e155 100644 (file)
@@ -76,7 +76,7 @@ class check_bigints extends XMLDBAction {
         $this->does_generate = ACTION_GENERATE_HTML;
 
     /// These are always here
-        global $CFG, $XMLDB, $db, $DB;
+        global $CFG, $XMLDB, $DB;
 
         $dbman = $DB->get_manager();
         $dbfamily = $DB->get_dbfamily();
index 60a7ed727b30ff28ac5e0758c9dce44992befbd5..ffa44717126061dd50713e5aa6c48993fa2513b6 100644 (file)
@@ -997,7 +997,7 @@ define('RESTORE_GROUPS_GROUPINGS', 3);
     //in backup_ids when restoring in a existing course
     function restore_create_sections(&$restore, $xml_file) {
 
-        global $CFG,$db;
+        global $CFG;
 
         $status = true;
         //Check it exists
@@ -1164,7 +1164,7 @@ define('RESTORE_GROUPS_GROUPINGS', 3);
 
     //Called to set up any course-format specific data that may be in the file
     function restore_set_format_data($restore,$xml_file) {
-        global $CFG,$db;
+        global $CFG;
 
         $status = true;
         //Check it exists
@@ -1202,7 +1202,7 @@ define('RESTORE_GROUPS_GROUPINGS', 3);
     //about each incidence
     function restore_create_metacourse($restore,$xml_file) {
 
-        global $CFG,$db;
+        global $CFG;
 
         $status = true;
         //Check it exists
@@ -2356,7 +2356,7 @@ define('RESTORE_GROUPS_GROUPINGS', 3);
     //user_course_creators and user_admins from xml
     function restore_create_users($restore,$xml_file) {
 
-        global $CFG, $db;
+        global $CFG;
         require_once ($CFG->dirroot.'/tag/lib.php');
 
         $status = true;
@@ -3078,7 +3078,7 @@ define('RESTORE_GROUPS_GROUPINGS', 3);
     //from xml
     function restore_create_questions($restore,$xml_file) {
 
-        global $CFG, $db;
+        global $CFG;
 
         $status = true;
         //Check it exists
@@ -3106,7 +3106,7 @@ define('RESTORE_GROUPS_GROUPINGS', 3);
     //This function creates all the scales
     function restore_create_scales($restore,$xml_file) {
 
-        global $CFG, $db;
+        global $CFG;
 
         $status = true;
         //Check it exists
@@ -3499,7 +3499,7 @@ define('RESTORE_GROUPS_GROUPINGS', 3);
     //This function creates all the course events
     function restore_create_events($restore,$xml_file) {
 
-        global $CFG, $db;
+        global $CFG;
 
         $status = true;
         //Check it exists
@@ -3957,7 +3957,7 @@ define('RESTORE_GROUPS_GROUPINGS', 3);
     //Depending what has been selected.
     function restore_create_logs($restore,$xml_file) {
 
-        global $CFG,$db;
+        global $CFG;
 
         //Number of records to get in every chunk
         $recordset_size = 4;
index 01a816c2f459549c7b71c05dd1b66f21548fc432..92fd0462e2874e1813db55aa4945b4a60e12b7bd 100644 (file)
@@ -37,7 +37,7 @@ function setup_enrolments(&$user) {
 
         /// Get the authoritative list of enrolments from the external database table
         /// We're using the ADOdb functions natively here and not our datalib functions
-        /// because we didn't want to mess with the $db global
+        /// because we didn't want to mess with the $ db global
 
         $useridfield = $enroldb->quote($user->{$CFG->enrol_localuserfield});
 
index 07820717b52c0834a9a428be2bd5114b21e1c27a..e5b67996f1d8cdc416f84ec36ea97502713937c9 100644 (file)
@@ -1797,7 +1797,6 @@ function coursemodule_visible_for_user($cm, $userid=0) {
  *
  * @uses $CFG
  * @uses $USER
- * @uses $db
  * @uses $REMOTE_ADDR
  * @uses SITEID
  * @param    int     $courseid  The course id
index 71cd733fb46bc5fbacd8ab19c02099442b2e9dd1..e5ddcdaccad386ca765204d41c2428360f9a370b 100644 (file)
@@ -680,7 +680,7 @@ function environment_check_php($version) {
  * @return object results encapsulated in one environment_result object
  */
 function environment_check_unicode($version) {
-    global $db, $DB;
+    global $DB;
 
     $result = new environment_results('unicode');
 
index 16ab63ba0638e8d88c000f3e2b90fa03d3495d0d..5488369aa05dea1e154afceec12df33c6ff221c2 100644 (file)
  * On success it prints a continue link. On failure it prints an error.
  *
  * @uses $CFG
- * @uses $db to do something really evil with the debug setting that should probably be eliminated. TODO!
  * @param string $continueto a URL passed to print_continue() if the local upgrades succeed.
  */
 function upgrade_local_db($continueto) {
 
-    global $CFG, $db;
+    global $CFG, $DB;
 
     // if we don't have code version or a db upgrade file, just return true, we're unneeded
     if (!file_exists($CFG->dirroot.'/local/version.php') || !file_exists($CFG->dirroot.'/local/db/upgrade.php')) {
index b101ff028b0f808ea424f5c580414400ab8f2a57..c21abaf598d926c1c7bcabbd8ae5f3e5fc6a7d31 100644 (file)
@@ -116,7 +116,6 @@ $response = mnet_server_dispatch($payload);
  * |                                                |
  * |________________________________________________|
  *
- * @uses $db
  * @param   string  $HTTP_RAW_POST_DATA   The XML that the client sent
  * @return  string                        The XMLRPC payload.
  */
index 0b3cd7e6bd8ada830cf36d656d003a91c5ba4767..ca1d18abb9f6f6d1ed6dbd5e71d8ea3a7d1047f6 100644 (file)
@@ -1005,7 +1005,7 @@ class assignment_base {
      *  Display all the submissions ready for grading
      */
     function display_submissions($message='') {
-        global $CFG, $db, $USER;
+        global $CFG, $DB, $USER;
         require_once($CFG->libdir.'/gradelib.php');
 
         /* first we check to see if the form has just been submitted
index bab4d385eba50cd841899052e2fe224f84604815..63f24a699b459910e3d0827b1a34990089100deb 100755 (executable)
@@ -194,7 +194,7 @@ function my_file_get_contents($filename, $use_include_path = 0) {
 // Read the records from the given file.
 // Perform a simple field count check for each record.
 function data_get_records_csv($filename, $fielddelimiter=',', $fieldenclosure="\n") {
-    global $db;
+    global $DB;
 
     if (empty($fielddelimiter)) {
         $fielddelimiter = ',';
index 0da5bf67314e45d347ef12165dbd10b0e74c20ce..9d0b7e1e6b850230d9f58d5d7cd23e8720595d2e 100644 (file)
@@ -321,8 +321,7 @@ function data_content_restore_mods ($old_record_id, $new_record_id, $old_data_id
 
 
 function data_restore_files ($old_data_id, $new_data_id, $old_field_id, $new_field_id, $old_record_id, $new_record_id, $recinfo, $restore) {
-
-    global $CFG, $db;
+    global $CFG, $DB;
 
     $status = true;
     $todo = false;
index 197c56871fa6524f62946064f1116ca8d826dbb7..284cf87d487cc0901f881a4ff4ebe167142e55b2 100644 (file)
@@ -6113,7 +6113,7 @@ function forum_tp_clean_read_records() {
  * Sets the last post for a given discussion
  **/
 function forum_discussion_update_last_post($discussionid) {
-    global $CFG, $db;
+    global $CFG, $DB;
 
 // Check the given discussion exists
     if (!record_exists('forum_discussions', 'id', $discussionid)) {
index ee7d177ddfe495ceae4f92a95ff3b5720a05c00f..4494baa21cfe488d82e9a66e3a8c1f9aaf1ff7a5 100644 (file)
@@ -34,7 +34,7 @@
 
     function forum_restore_mods($mod,$restore) {
         
-        global $CFG,$db;
+        global $CFG,$DB;
 
         $status = true;
 
index 0ac81b89a24cf2ebe815244238f0dac64d43f3a9..7208364b9bac192c0e3fe66459e25d811fe12d39 100644 (file)
@@ -1387,7 +1387,7 @@ function hotpot_scale_used_anywhere($scaleid) {
 
 
 function hotpot_add_attempt($hotpotid) {
-    global $db, $CFG, $USER;
+    global $DB, $CFG, $USER;
 
     // get start time of this attempt
     $time = time();
index 2a47c3d757f30bd21e0a5adfdcfdc654c3d7b448..eb93a46d9afcf2666ee30fabeb87a35f4effb98b 100644 (file)
@@ -17,7 +17,7 @@ class quiz_report extends quiz_default_report {
      * Display the report.
      */
     function display($quiz, $cm, $course) {
-        global $CFG, $db;
+        global $CFG, $DB;
         // Define some strings
         $strreallydel  = addslashes(get_string('deleteattemptcheck','quiz'));
         $strtimeformat = get_string('strftimedatetime');
index d788b00c2e3a8fb5c4925e8cbab3eeaffab94cfe..a31ac8732908e75591d79ae3ff05b6bd68a23ed1 100644 (file)
@@ -339,7 +339,7 @@ function survey_print_all_responses($cmid, $results, $courseid) {
 
 
 function survey_get_template_name($templateid) {
-    global $db;
+    global $DB;
 
     if ($templateid) {
         if ($ss = get_record("surveys", "id", $templateid)) {
@@ -363,7 +363,7 @@ function survey_shorten_name ($name, $numwords) {
 
 
 function survey_print_multi($question) {
-    global $USER, $db, $qnum, $checklist;
+    global $USER, $DB, $qnum, $checklist;
 
     $stripreferthat = get_string("ipreferthat", "survey");
     $strifoundthat = get_string("ifoundthat", "survey");
@@ -458,7 +458,7 @@ function survey_print_multi($question) {
 
 
 function survey_print_single($question) {
-    global $db, $qnum;
+    global $DB, $qnum;
 
     $rowclass = survey_question_rowclass(0);
 
index 90525d53d7a79794eba5e595b8c93a23f840694f..25b02b16bc1df7216c68f1e66b492d9593bf00ea 100644 (file)
@@ -25,7 +25,7 @@
 
     function survey_restore_mods($mod,$restore) {
 
-        global $CFG,$db;
+        global $CFG,$DB;
 
         $status = true;
 
index d518d71e7d8db9ea3e9023b524fd278733402add..3d47b52d144b3c91b7a36674f841d8d225904d35 100644 (file)
@@ -48,11 +48,11 @@ function ewiki_initialization_wizard($id, &$data, &$action) {
 
          #-- analyze and print settings and misconfigurations
          $pf_db = $ewiki_plugins["database"][0];
-         $db = substr($pf_db, strrpos($pf_db, "_") + 1);
+         $xdb = substr($pf_db, strrpos($pf_db, "_") + 1);
          $o .= '<table border="0" width="90%" class="diagnosis">';
          $o .= '<tr><td>DatabaseBackend</td><td>';
-         $o .= "<b>" . $db . "</b><br />";
-         if ($db == "files") {
+         $o .= "<b>" . $xdb . "</b><br />";
+         if ($xdb == "files") {
             $o .= "<small>_DBFILES_DIR='</small><tt>" . EWIKI_DBFILES_DIRECTORY . "'</tt>";
             if (strpos(EWIKI_DBFILES_DIRECTORY, "tmp")) {
                $o .= "<br /><b>Warning</b>: Storing your pages into a temporary directory is not what you want (there they would get deleted randomly), except for testing purposes of course. See the README.";
index b107ec1a5acb3b55b70d0a56c385175ac04d31d0..8f76c47039fd9c2f0d703976c7b0e6bd73bff234 100644 (file)
@@ -199,7 +199,7 @@ class IndexDBControl {
     * @deprecated Database is installed at install and should not be dropped out
     */
     public function checkDB() {
-        global $CFG, $db;
+        global $CFG, $DB;
         
         $sqlfile = "{$CFG->dirroot}/search/db/$CFG->dbtype.sql";
         $ret = false;
@@ -222,7 +222,7 @@ class IndexDBControl {
     * @uses db, CFG
     */
     public function addDocument($document=null) {
-        global $db, $CFG;
+        global $DB, $CFG;
         
         if ($document == null) {
              return false;
@@ -251,7 +251,7 @@ class IndexDBControl {
     * @uses db
     */
     public function delDocument($document) {
-        global $db;
+        global $DB;
         
         delete_records(SEARCH_DATABASE_TABLE, 'id', $document->dbid);
     }