From 764ec006839636a5dc7bd6bf65760037570a16c0 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Thu, 21 May 2015 15:11:36 +0200 Subject: tests: Rework database handling We no longer interfere with the normal installation's database settings. Signed-off-by: Florian Pritz --- application/controllers/tools.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'application/controllers') diff --git a/application/controllers/tools.php b/application/controllers/tools.php index d38ab7c39..a444e6024 100644 --- a/application/controllers/tools.php +++ b/application/controllers/tools.php @@ -43,14 +43,14 @@ class Tools extends MY_Controller { } } - function drop_all_tables_using_prefix() + function drop_all_tables() { $tables = $this->db->list_tables(); $prefix = $this->db->dbprefix; $tables_to_drop = array(); foreach ($tables as $table) { - if (strpos($table, $prefix) === 0) { + if ($prefix === "" || strpos($table, $prefix) === 0) { $tables_to_drop[] = $this->db->protect_identifiers($table); } } -- cgit v1.2.3-24-g4f1b