Skip to content

Commit

Permalink
MDL-14679 towards adodb separation
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Jun 9, 2008
1 parent 294ce98 commit 96d1387
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 43 deletions.
16 changes: 0 additions & 16 deletions admin/dbperformance.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,3 @@
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>
2 changes: 1 addition & 1 deletion enrol/database/enrol.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 0 additions & 17 deletions lib/ddl/database_manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ public function index_exists($table, $xmldb_index) {
* 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
Expand Down Expand Up @@ -257,7 +256,6 @@ public function find_check_constraint_name($xmldb_table, $xmldb_field) {
/**
* 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
Expand All @@ -273,7 +271,6 @@ public function check_constraint_exists($xmldb_table, $xmldb_field) {
* 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
Expand Down Expand Up @@ -633,7 +630,6 @@ public function rename_table($xmldb_table, $newname, $continue=true, $feedback=t
/**
* 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)
Expand Down Expand Up @@ -675,7 +671,6 @@ public function add_field($xmldb_table, $xmldb_field, $continue=true, $feedback=
/**
* 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)
Expand Down Expand Up @@ -710,7 +705,6 @@ public function drop_field($xmldb_table, $xmldb_field, $continue=true, $feedback
/**
* 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)
Expand Down Expand Up @@ -745,7 +739,6 @@ public function change_field_type($xmldb_table, $xmldb_field, $continue=true, $f
/**
* 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)
Expand All @@ -761,7 +754,6 @@ public function change_field_precision($xmldb_table, $xmldb_field, $continue=tru
/**
* 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)
Expand All @@ -777,7 +769,6 @@ public function change_field_unsigned($xmldb_table, $xmldb_field, $continue=true
/**
* 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)
Expand Down Expand Up @@ -843,7 +834,6 @@ public function change_field_enum($xmldb_table, $xmldb_field, $continue=true, $f
* 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)
Expand Down Expand Up @@ -879,7 +869,6 @@ public function change_field_default($xmldb_table, $xmldb_field, $continue=true,
* 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
Expand Down Expand Up @@ -948,7 +937,6 @@ public function rename_field($xmldb_table, $xmldb_field, $newname, $continue=tru
/**
* 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)
Expand Down Expand Up @@ -981,7 +969,6 @@ public function add_key($xmldb_table, $xmldb_key, $continue=true, $feedback=true
/**
* 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)
Expand Down Expand Up @@ -1015,7 +1002,6 @@ public function drop_key($xmldb_table, $xmldb_key, $continue=true, $feedback=tru
* 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
Expand Down Expand Up @@ -1055,7 +1041,6 @@ public function rename_key($xmldb_table, $xmldb_key, $newname, $continue=true, $
* 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)
Expand Down Expand Up @@ -1091,7 +1076,6 @@ public function add_index($xmldb_table, $xmldb_intex, $continue=true, $feedback=
* 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)
Expand Down Expand Up @@ -1128,7 +1112,6 @@ public function drop_index($xmldb_table, $xmldb_intex, $continue=true, $feedback
* 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
Expand Down
3 changes: 0 additions & 3 deletions lib/ddl/mssql_sql_generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,6 @@ public function getEnumExtraSQL($xmldb_table, $xmldb_field) {
* check constraints
*/
public function getDropFieldSQL($xmldb_table, $xmldb_field) {

global $db;

$results = array();

/// Get the quoted name of the table and field
Expand Down
3 changes: 0 additions & 3 deletions lib/ddl/postgres_sql_generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,6 @@ public function getAddFieldSQL($xmldb_table, $xmldb_field, $skip_type_clause = N
* - 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
Expand Down
3 changes: 1 addition & 2 deletions lib/dml/moodle_database.php
Original file line number Diff line number Diff line change
Expand Up @@ -1159,7 +1159,7 @@ public function sql_compare_text($fieldname, $numchars=32) {

/**
* 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
Expand All @@ -1170,7 +1170,6 @@ public abstract function sql_concat();
* 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
Expand Down
2 changes: 1 addition & 1 deletion mod/chat/restorelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function chat_restore_mods($mod,$restore) {
$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')) {
Expand Down

0 comments on commit 96d1387

Please sign in to comment.