summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--installer/cli.php5
-rw-r--r--installer/installer.php3
-rw-r--r--installer/views/db_not_empty.html.php7
3 files changed, 9 insertions, 6 deletions
diff --git a/installer/cli.php b/installer/cli.php
index a853f67b..199172dc 100644
--- a/installer/cli.php
+++ b/installer/cli.php
@@ -37,8 +37,9 @@ if (!installer::connect($config)) {
oops("Database {$config['dbname']} doesn't exist and can't be created. " .
"Please create the database by hand.");
} else if (!installer::db_empty($config)) {
- oops("Database {$config['dbname']} already has tables in it. " .
- "Please specify an empty database.\n");
+ oops("Database {$config['dbname']} already has Gallery 3 tables in it. \n" .
+ " Please remove the Gallery 3 tables, change your prefix,\n" .
+ " or specify an empty database.\n");
} else if (!installer::unpack_var()) {
oops("Unable to create files inside the 'var' directory");
} else if (!installer::unpack_sql($config)) {
diff --git a/installer/installer.php b/installer/installer.php
index 2a8b6219..55ba4c60 100644
--- a/installer/installer.php
+++ b/installer/installer.php
@@ -76,7 +76,8 @@ class installer {
}
static function db_empty($config) {
- return mysql_num_rows(mysql_query("SHOW TABLES FROM {$config['dbname']}")) == 0;
+ $query = "SHOW TABLES IN {$config[dbname]} LIKE '{$config[prefix]}items'";
+ return mysql_num_rows(mysql_query($query)) == 0;
}
static function create_admin($config) {
diff --git a/installer/views/db_not_empty.html.php b/installer/views/db_not_empty.html.php
index 7125a0b6..bc45458d 100644
--- a/installer/views/db_not_empty.html.php
+++ b/installer/views/db_not_empty.html.php
@@ -1,7 +1,8 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<h1> Uh oh! </h1>
<p class="error">
- The database you provided already has other tables in it.
- Continuing with the install might overwrite an existing Gallery
- install. Please go back and choose a different database.
+ The database you provided already has Gallery 3 tables in it.
+ Continuing with the install would overwrite your existing install.
+ Please either use a different database, delete the old tables,
+ or choose a different table prefix.
</p>