]> git.mjollnir.org Git - moodle.git/commitdiff
Undoing my hacks to try and keep this code clean as possible.
authormoodler <moodler>
Wed, 4 Oct 2006 15:30:54 +0000 (15:30 +0000)
committermoodler <moodler>
Wed, 4 Oct 2006 15:30:54 +0000 (15:30 +0000)
lib/ddllib.php

index a70d9dc6537f4856540c8be0972d7d41e39768e4..b541993b595707061c2bd5608dd17c184d7c5867 100644 (file)
@@ -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;
     }