From bf4d434c86039a31c976397fddaf966f1b614ee9 Mon Sep 17 00:00:00 2001 From: jgen Date: Thu, 28 Nov 2013 00:31:09 -0500 Subject: [PATCH] Fixes for the installer. Display error messages on failures, as well as actually check for tables before installing. --- core/database.class.php | 2 + install.php | 108 ++++++++++++++++++++++++++++++++++------ 2 files changed, 94 insertions(+), 16 deletions(-) diff --git a/core/database.class.php b/core/database.class.php index 97f7c717..e7c4e27d 100644 --- a/core/database.class.php +++ b/core/database.class.php @@ -470,6 +470,8 @@ class Database { * Returns the number of tables present in the current database. */ public function count_tables() { + if(is_null($this->db) || is_null($this->engine)) $this->connect_db(); + if($this->engine->name === "mysql") { return count( $this->get_all("SHOW TABLES") diff --git a/install.php b/install.php index f2984e9e..a52154e5 100644 --- a/install.php +++ b/install.php @@ -1,8 +1,14 @@ - +