]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-14679 towards adodb separation
authorskodak <skodak>
Mon, 9 Jun 2008 18:48:28 +0000 (18:48 +0000)
committerskodak <skodak>
Mon, 9 Jun 2008 18:48:28 +0000 (18:48 +0000)
admin/dbperformance.php
enrol/database/enrol.php
lib/ddl/database_manager.php
lib/ddl/mssql_sql_generator.php
lib/ddl/postgres_sql_generator.php
lib/dml/moodle_database.php
mod/chat/restorelib.php

index 3bfd4566afcc1ee323a00d9f2b486ecbde4643b2..04c8669eb7de226e1bdd46240a5aa91def56e2ac 100644 (file)
@@ -27,19 +27,3 @@ error('TODO: rewrite db perf code'); // TODO: rewrite
         print_header("$site->shortname: $strdatabaseperformance", "$site->fullname", $navigation);
         exit;
     }
-
-    if (!empty($bottomframe) or !empty($do)) {
-        $perf =&NewPerfMonitor($db);
-        $perf->UI($pollsecs=5);
-        exit;
-    }
-
-?>
-<head>
-<title><?php echo "$site->shortname: $strdatabaseperformance" ?></title>
-</head>
-
-<frameset rows="80,*">
-   <frame src="dbperformance.php?topframe=true">
-   <frame src="dbperformance.php?bottomframe=true">
-</frameset>
index aa5a3c141d7bdba3dbb8d397eb37fc4f55f5dc22..17841e05827df7631d99ded1dafe3b0f34d70ddf 100644 (file)
@@ -173,7 +173,7 @@ function setup_enrolments(&$user) {
  * used.
  */
 function sync_enrolments($role = null) {
-    global $CFG, $db, $DB;
+    global $CFG, $DB;
     error_reporting(E_ALL);
 
     // Connect to the external database
index 6382f41bfcc5e2dd356a1c693f629ee65547a9e7..b9ded9841a1e744438b0ebdbf20745f7649e57d6 100644 (file)
@@ -218,7 +218,6 @@ class database_manager {
      * to 1 "enum-like" constraint. So, if more than one is returned, only the first one will be
      * retrieved by this funcion.
      *
-     * @uses, $db
      * @param xmldb_table the table to be searched
      * @param xmldb_field the field to be searched
      * @return string check constraint name or false
@@ -257,7 +256,6 @@ class database_manager {
     /**
      * Given one xmldb_field, check if it has a check constraint in DB
      *
-     * @uses, $db
      * @param xmldb_table the table
      * @param xmldb_field the field to be searched for any existing constraint
      * @return boolean true/false
@@ -273,7 +271,6 @@ class database_manager {
      * Given one xmldb_key, the function returns the name of the key in DB (if exists)
      * of false if it doesn't exist
      *
-     * @uses, $db
      * @param xmldb_table the table to be searched
      * @param xmldb_key the key to be searched
      * @return string key name of false
@@ -633,7 +630,6 @@ class database_manager {
     /**
      * This function will add the field to the table passed as arguments
      *
-     * @uses $CFG, $db
      * @param xmldb_table table object (just the name is mandatory)
      * @param xmldb_field field object (full specs are required)
      * @param boolean continue to specify if must continue on error (true) or stop (false)
@@ -675,7 +671,6 @@ class database_manager {
     /**
      * This function will drop the field from the table passed as arguments
      *
-     * @uses $CFG, $db
      * @param xmldb_table table object (just the name is mandatory)
      * @param xmldb_field field object (just the name is mandatory)
      * @param boolean continue to specify if must continue on error (true) or stop (false)
@@ -710,7 +705,6 @@ class database_manager {
     /**
      * This function will change the type of the field in the table passed as arguments
      *
-     * @uses $CFG, $db
      * @param xmldb_table table object (just the name is mandatory)
      * @param xmldb_field field object (full specs are required)
      * @param boolean continue to specify if must continue on error (true) or stop (false)
@@ -745,7 +739,6 @@ class database_manager {
     /**
      * This function will change the precision of the field in the table passed as arguments
      *
-     * @uses $CFG, $db
      * @param xmldb_table table object (just the name is mandatory)
      * @param xmldb_field field object (full specs are required)
      * @param boolean continue to specify if must continue on error (true) or stop (false)
@@ -761,7 +754,6 @@ class database_manager {
     /**
      * This function will change the unsigned/signed of the field in the table passed as arguments
      *
-     * @uses $CFG, $db
      * @param xmldb_table table object (just the name is mandatory)
      * @param xmldb_field field object (full specs are required)
      * @param boolean continue to specify if must continue on error (true) or stop (false)
@@ -777,7 +769,6 @@ class database_manager {
     /**
      * This function will change the nullability of the field in the table passed as arguments
      *
-     * @uses $CFG, $db
      * @param xmldb_table table object (just the name is mandatory)
      * @param xmldb_field field object (full specs are required)
      * @param boolean continue to specify if must continue on error (true) or stop (false)
@@ -843,7 +834,6 @@ class database_manager {
      * This function will change the default of the field in the table passed as arguments
      * One null value in the default field means delete the default
      *
-     * @uses $CFG, $db
      * @param xmldb_table table object (just the name is mandatory)
      * @param xmldb_field field object (full specs are required)
      * @param boolean continue to specify if must continue on error (true) or stop (false)
@@ -879,7 +869,6 @@ class database_manager {
      * This function will rename the field in the table passed as arguments
      * Before renaming the field, the function will check it exists
      *
-     * @uses $CFG, $db
      * @param xmldb_table table object (just the name is mandatory)
      * @param xmldb_field index object (full specs are required)
      * @param string new name of the field
@@ -948,7 +937,6 @@ class database_manager {
     /**
      * This function will create the key in the table passed as arguments
      *
-     * @uses $CFG, $db
      * @param xmldb_table table object (just the name is mandatory)
      * @param xmldb_key index object (full specs are required)
      * @param boolean continue to specify if must continue on error (true) or stop (false)
@@ -981,7 +969,6 @@ class database_manager {
     /**
      * This function will drop the key in the table passed as arguments
      *
-     * @uses $CFG, $db
      * @param xmldb_table table object (just the name is mandatory)
      * @param xmldb_key key object (full specs are required)
      * @param boolean continue to specify if must continue on error (true) or stop (false)
@@ -1015,7 +1002,6 @@ class database_manager {
      * This function will rename the key in the table passed as arguments
      * Experimental. Shouldn't be used at all in normal installation/upgrade!
      *
-     * @uses $CFG, $db
      * @param xmldb_table table object (just the name is mandatory)
      * @param xmldb_key key object (full specs are required)
      * @param string new name of the key
@@ -1055,7 +1041,6 @@ class database_manager {
      * This function will create the index in the table passed as arguments
      * Before creating the index, the function will check it doesn't exists
      *
-     * @uses $CFG, $db
      * @param xmldb_table table object (just the name is mandatory)
      * @param xmldb_index index object (full specs are required)
      * @param boolean continue to specify if must continue on error (true) or stop (false)
@@ -1091,7 +1076,6 @@ class database_manager {
      * This function will drop the index in the table passed as arguments
      * Before dropping the index, the function will check it exists
      *
-     * @uses $CFG, $db
      * @param xmldb_table table object (just the name is mandatory)
      * @param xmldb_index index object (full specs are required)
      * @param boolean continue to specify if must continue on error (true) or stop (false)
@@ -1128,7 +1112,6 @@ class database_manager {
      * Before renaming the index, the function will check it exists
      * Experimental. Shouldn't be used at all!
      *
-     * @uses $CFG, $db
      * @param xmldb_table table object (just the name is mandatory)
      * @param xmldb_index index object (full specs are required)
      * @param string new name of the index
index 8a771572981d9436771db4af073d04fae3174cf8..0269d4e577c107d289176f7d132e9d10bc5b350d 100644 (file)
@@ -188,9 +188,6 @@ class mssql_sql_generator extends sql_generator {
      * check constraints
      */
     public function getDropFieldSQL($xmldb_table, $xmldb_field) {
-
-        global $db;
-
         $results = array();
 
     /// Get the quoted name of the table and field
index ccd1ca78dca21678d4c640d26665f68024d69368..b5aaccb6130e41baaaa035bdcb841cb19a123ca1 100644 (file)
@@ -236,9 +236,6 @@ class postgres_sql_generator extends sql_generator {
      *     - Changes in default require the SET/DROP DEFAULT clause
      */
     public function getAlterFieldSQL($xmldb_table, $xmldb_field) {
-
-        global $db;
-
         $results = array(); /// To store all the needed SQL commands
 
     /// Get the normla names of the table and field
index e170e7c77328ac3cc873a2391993b663b99a4e0b..40b6b0026d88fded4708aefa1cdaeb8a8c68d8a1 100644 (file)
@@ -1159,7 +1159,7 @@ abstract class moodle_database {
 
     /**
      * Returns the proper SQL to do CONCAT between the elements passed
-     * Can take many parameters - just a passthrough to $db->Concat()
+     * Can take many parameters
      *
      * @param string $element
      * @return string
@@ -1170,7 +1170,6 @@ abstract class moodle_database {
      * Returns the proper SQL to do CONCAT between the elements passed
      * with a given separator
      *
-     * @uses $db
      * @param string $separator
      * @param array  $elements
      * @return string
index 587caef52df9410f38b97b2222f420d7016456d3..217d4862bebb3f58da834d598ab3a20c94317a95 100644 (file)
@@ -52,7 +52,7 @@
             $chat->timemodified = backup_todb($info['MOD']['#']['TIMEMODIFIED']['0']['#']);
 
             //The structure is equal to the db, so insert the chat
-            $newid = $db->insert_record ("chat",$chat);
+            $newid = $DB->insert_record ("chat",$chat);
 
             //Do some output     
             if (!defined('RESTORE_SILENTLY')) {