From a9b1f143d28484a46120ffad03e381d81178d7ec Mon Sep 17 00:00:00 2001 From: moodler Date: Wed, 4 Oct 2006 15:30:54 +0000 Subject: [PATCH] Undoing my hacks to try and keep this code clean as possible. --- lib/ddllib.php | 113 ------------------------------------------------- 1 file changed, 113 deletions(-) diff --git a/lib/ddllib.php b/lib/ddllib.php index a70d9dc653..b541993b59 100644 --- a/lib/ddllib.php +++ b/lib/ddllib.php @@ -251,11 +251,6 @@ function table_exists($table) { $exists = true; -/// Retrieve the table object in case just a name was supplied - if (is_string($table)) { - $table = new XMLDBTable($table); - } - /// Do this function silenty (to avoid output in install/upgrade process) $olddbdebug = $db->debug; $db->debug = false; @@ -295,16 +290,6 @@ function field_exists($table, $field) { $exists = true; -/// Retrieve the table object in case just a name was supplied - if (is_string($table)) { - $table = new XMLDBTable($table); - } - -/// Retrieve the field object in case just a name was supplied - if (is_string($field)) { - $field = new XMLDBField($field); - } - /// Do this function silenty (to avoid output in install/upgrade process) $olddbdebug = $db->debug; $db->debug = false; @@ -352,16 +337,6 @@ function index_exists($table, $index) { $exists = true; -/// Retrieve the table object in case just a name was supplied - if (is_string($table)) { - $table = new XMLDBTable($table); - } - -/// Retrieve the index object in case just a name was supplied - if (is_string($index)) { - $index = new XMLDBIndex($index); - } - /// Do this function silenty (to avoid output in install/upgrade process) $olddbdebug = $db->debug; $db->debug = false; @@ -580,11 +555,6 @@ function drop_table($table, $continue=true, $feedback=true) { $status = true; -/// Retrieve the table object in case just a name was supplied - if (is_string($table)) { - $table = new XMLDBTable($table); - } - if (strtolower(get_class($table)) != 'xmldbtable') { return false; } @@ -619,11 +589,6 @@ function rename_table($table, $newname, $continue=true, $feedback=true) { $status = true; -/// Retrieve the table object in case just a name was supplied - if (is_string($table)) { - $table = new XMLDBTable($table); - } - if (strtolower(get_class($table)) != 'xmldbtable') { return false; } @@ -663,11 +628,6 @@ function add_field($table, $field, $continue=true, $feedback=true) { $status = true; -/// Retrieve the table object in case just a name was supplied - if (is_string($table)) { - $table = new XMLDBTable($table); - } - if (strtolower(get_class($table)) != 'xmldbtable') { return false; } @@ -704,11 +664,6 @@ function drop_field($table, $field, $continue=true, $feedback=true) { $status = true; -/// Retrieve the table object in case just a name was supplied - if (is_string($table)) { - $table = new XMLDBTable($table); - } - if (strtolower(get_class($table)) != 'xmldbtable') { return false; } @@ -745,12 +700,6 @@ function change_field_type($table, $field, $continue=true, $feedback=true) { $status = true; -/// Retrieve the table object in case just a name was supplied - - if (is_string($table)) { - $table = new XMLDBTable($table); - } - if (strtolower(get_class($table)) != 'xmldbtable') { return false; } @@ -829,11 +778,6 @@ function change_field_enum($table, $field, $continue=true, $feedback=true) { $status = true; -/// Retrieve the table object in case just a name was supplied - if (is_string($table)) { - $table = new XMLDBTable($table); - } - if (strtolower(get_class($table)) != 'xmldbtable') { return false; } @@ -864,11 +808,6 @@ function change_field_default($table, $field, $continue=true, $feedback=true) { $status = true; -/// Retrieve the table object in case just a name was supplied - if (is_string($table)) { - $table = new XMLDBTable($table); - } - if (strtolower(get_class($table)) != 'xmldbtable') { return false; } @@ -899,17 +838,6 @@ function rename_field($table, $field, $newname, $continue=true, $feedback=true) global $CFG, $db; -/// Retrieve the table object in case just a name was supplied - if (is_string($table)) { - $table = new XMLDBTable($table); - } - -/// Retrieve the field object in case just a name was supplied - if (is_string($field)) { - $field = new XMLDBField($field); - } - - $status = true; if (strtolower(get_class($table)) != 'xmldbtable') { @@ -960,11 +888,6 @@ function add_key($table, $key, $continue=true, $feedback=true) { $status = true; -/// Retrieve the table object in case just a name was supplied - if (is_string($table)) { - $table = new XMLDBTable($table); - } - if (strtolower(get_class($table)) != 'xmldbtable') { return false; } @@ -999,11 +922,6 @@ function drop_key($table, $key, $continue=true, $feedback=true) { $status = true; -/// Retrieve the table object in case just a name was supplied - if (is_string($table)) { - $table = new XMLDBTable($table); - } - if (strtolower(get_class($table)) != 'xmldbtable') { return false; } @@ -1042,11 +960,6 @@ function rename_key($table, $key, $newname, $continue=true, $feedback=true) { $status = true; -/// Retrieve the table object in case just a name was supplied - if (is_string($table)) { - $table = new XMLDBTable($table); - } - if (strtolower(get_class($table)) != 'xmldbtable') { return false; } @@ -1085,11 +998,6 @@ function add_index($table, $index, $continue=true, $feedback=true) { $status = true; -/// Retrieve the table object in case just a name was supplied - if (is_string($table)) { - $table = new XMLDBTable($table); - } - if (strtolower(get_class($table)) != 'xmldbtable') { return false; } @@ -1127,17 +1035,6 @@ function drop_index($table, $index, $continue=true, $feedback=true) { $status = true; -/// Retrieve the table object in case just a name was supplied - if (is_string($table)) { - $table = new XMLDBTable($table); - } - -/// Retrieve the index object in case just a name was supplied - if (is_string($index)) { - $index = new XMLDBIndex($index); - } - - if (strtolower(get_class($table)) != 'xmldbtable') { return false; } @@ -1179,16 +1076,6 @@ function rename_index($table, $index, $newname, $continue=true, $feedback=true) $status = true; -/// Retrieve the table object in case just a name was supplied - if (is_string($table)) { - $table = new XMLDBTable($table); - } -/// Retrieve the index object in case just a name was supplied - if (is_string($index)) { - $index = new XMLDBIndex($index); - } - - if (strtolower(get_class($table)) != 'xmldbtable') { return false; } -- 2.39.5