]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-16483 Reverting as Petr ordered... I mean, suggested.
authornicolasconnault <nicolasconnault>
Tue, 16 Sep 2008 14:35:15 +0000 (14:35 +0000)
committernicolasconnault <nicolasconnault>
Tue, 16 Sep 2008 14:35:15 +0000 (14:35 +0000)
lib/dml/adodb_moodle_database.php
lib/dml/moodle_database.php
lib/dml/sqlite3_pdo_moodle_database.php

index 5b9a67ecfe33f4a1df0e233efdfb5e0b0ccb7f63..8117853dffd6145e21c2b8015e5e7197f20e2de4 100644 (file)
@@ -93,18 +93,14 @@ abstract class adodb_moodle_database extends moodle_database {
      * Return tables in database WITHOUT current prefix
      * @return array of table names in lowercase and without prefix
      */
-    public function get_tables($prefix=null) {
+    public function get_tables() {
         $metatables = $this->adodb->MetaTables();
         $tables = array();
 
-        if (is_null($prefix)) {
-            $prefix = $this->prefix;
-        }
-
         foreach ($metatables as $table) {
             $table = strtolower($table);
-            if (empty($prefix) || strpos($table, $prefix) === 0) {
-                $tablename = substr($table, strlen($prefix));
+            if (empty($this->prefix) || strpos($table, $this->prefix) === 0) {
+                $tablename = substr($table, strlen($this->prefix));
                 $tables[$tablename] = $tablename;
             }
         }
index f2b17338c8f068bcfd90df34d166c85eafef7265..8539eba44818dd9de4460621c5c97dcc740de36e 100644 (file)
@@ -438,7 +438,7 @@ abstract class moodle_database {
      * Return tables in database WITHOUT current prefix
      * @return array of table names in lowercase and without prefix
      */
-    public abstract function get_tables($prefix=null);
+    public abstract function get_tables();
 
     /**
      * Return table indexes - everything lowercased
index 375429e4d7ca95905784f4e138044a3ca979ad17..48acd769605868c44a605ee2348efd6bbbdf16c4 100644 (file)
@@ -108,13 +108,9 @@ class sqlite3_pdo_moodle_database extends pdo_moodle_database {
      * Return tables in database WITHOUT current prefix
      * @return array of table names in lowercase and without prefix
      */
-    public function get_tables($prefix=null) {
+    public function get_tables() {
         $tables = array();
 
-        if (is_null($prefix)) {
-            $prefix = $this->prefix;
-        }
-
         $sql = 'SELECT name FROM sqlite_master WHERE type="table" UNION ALL SELECT name FROM sqlite_temp_master WHERE type="table" ORDER BY name';
         if ($this->debug) {
             $this->debug_query($sql);
@@ -123,8 +119,8 @@ class sqlite3_pdo_moodle_database extends pdo_moodle_database {
         foreach ($rstables as $table) {
             $table = $table['name'];
             $table = strtolower($table);
-            if (empty($prefix) || strpos($table, $prefix) === 0) {
-                $table = substr($table, strlen($prefix));
+            if (empty($this->prefix) || strpos($table, $this->prefix) === 0) {
+                $table = substr($table, strlen($this->prefix));
                 $tables[$table] = $table;
             }
         }