mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 20:42:22 +02:00
MDL-16483 Reverting as Petr ordered... I mean, suggested.
This commit is contained in:
parent
abcd0fc53e
commit
ba14791091
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user