summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
Diffstat (limited to 'application')
-rw-r--r--application/config/example/database.php7
-rw-r--r--application/controllers/tools.php4
2 files changed, 9 insertions, 2 deletions
diff --git a/application/config/example/database.php b/application/config/example/database.php
index 51b666b38..7a0e63d56 100644
--- a/application/config/example/database.php
+++ b/application/config/example/database.php
@@ -64,6 +64,13 @@ $db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;
+if (getenv("ENVIRONMENT") === "testsuite") {
+ // Change these to your likeing, just make sure they
+ // don't overlap with the normal settings.
+ $db['default']['database'] = "filebin_testsuite";
+ $db['default']['dbprefix'] = "testsuite-prefix-";
+}
+
/* End of file database.php */
/* Location: ./application/config/database.php */ \ No newline at end of file
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);
}
}