mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Ensure that MySQLDatabase::tableList() always returns an array
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@60607 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
26f3dc26da
commit
ab6d6dd32f
@ -368,11 +368,12 @@ class MySQLDatabase extends Database {
|
|||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function tableList() {
|
public function tableList() {
|
||||||
|
$tables = array();
|
||||||
foreach($this->query("SHOW TABLES") as $record) {
|
foreach($this->query("SHOW TABLES") as $record) {
|
||||||
$table = strtolower(reset($record));
|
$table = strtolower(reset($record));
|
||||||
$tables[$table] = $table;
|
$tables[$table] = $table;
|
||||||
}
|
}
|
||||||
return isset($tables) ? $tables : null;
|
return $tables;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user