From 96d13878095555b96d1d65228fafdd0bedfb53e3 Mon Sep 17 00:00:00 2001 From: skodak Date: Mon, 9 Jun 2008 18:48:28 +0000 Subject: [PATCH] MDL-14679 towards adodb separation --- admin/dbperformance.php | 16 ---------------- enrol/database/enrol.php | 2 +- lib/ddl/database_manager.php | 17 ----------------- lib/ddl/mssql_sql_generator.php | 3 --- lib/ddl/postgres_sql_generator.php | 3 --- lib/dml/moodle_database.php | 3 +-- mod/chat/restorelib.php | 2 +- 7 files changed, 3 insertions(+), 43 deletions(-) diff --git a/admin/dbperformance.php b/admin/dbperformance.php index 3bfd4566af..04c8669eb7 100644 --- a/admin/dbperformance.php +++ b/admin/dbperformance.php @@ -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; - } - -?> - -<?php echo "$site->shortname: $strdatabaseperformance" ?> - - - - - - diff --git a/enrol/database/enrol.php b/enrol/database/enrol.php index aa5a3c141d..17841e0582 100644 --- a/enrol/database/enrol.php +++ b/enrol/database/enrol.php @@ -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 diff --git a/lib/ddl/database_manager.php b/lib/ddl/database_manager.php index 6382f41bfc..b9ded9841a 100644 --- a/lib/ddl/database_manager.php +++ b/lib/ddl/database_manager.php @@ -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 diff --git a/lib/ddl/mssql_sql_generator.php b/lib/ddl/mssql_sql_generator.php index 8a77157298..0269d4e577 100644 --- a/lib/ddl/mssql_sql_generator.php +++ b/lib/ddl/mssql_sql_generator.php @@ -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 diff --git a/lib/ddl/postgres_sql_generator.php b/lib/ddl/postgres_sql_generator.php index ccd1ca78dc..b5aaccb613 100644 --- a/lib/ddl/postgres_sql_generator.php +++ b/lib/ddl/postgres_sql_generator.php @@ -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 diff --git a/lib/dml/moodle_database.php b/lib/dml/moodle_database.php index e170e7c773..40b6b0026d 100644 --- a/lib/dml/moodle_database.php +++ b/lib/dml/moodle_database.php @@ -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 diff --git a/mod/chat/restorelib.php b/mod/chat/restorelib.php index 587caef52d..217d4862be 100644 --- a/mod/chat/restorelib.php +++ b/mod/chat/restorelib.php @@ -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')) { -- 2.39.5