summaryrefslogtreecommitdiff
path: root/installer/installer.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-05-13 00:32:19 +0000
committerBharat Mediratta <bharat@menalto.com>2009-05-13 00:32:19 +0000
commit7008bfb5c3b0654d7d25b2e0d0d53d09e4431c0c (patch)
tree80574dc1c08ef447cb24f31bcc511ae07f6f4cf1 /installer/installer.php
parent847de449968dfc815066eac719ddacf60639206c (diff)
Warn the user if they're attemping to reinstall into a database that
already has Gallery 3 tables. Otherwise, permit it to continue. We key this off of the existence of the g3_items table. Theoretically it's possible that the g3_items table is gone but other tables are still there, which could mess things up. I'm not going to worry about that for now. Fixes ticket #175
Diffstat (limited to 'installer/installer.php')
-rw-r--r--installer/installer.php3
1 files changed, 2 insertions, 1 deletions
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) {