aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-02-19 18:06:10 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-02-19 18:06:10 +0000
commitcafcdde55a42f747d73f64d59e7839281469346b (patch)
tree0bc220a3aaaacda3f5b27b7a0c450218c3157a6e
parentd12cbcc1ce3fcfef0b944f5c70df6a9caf36830c (diff)
downloadelgg-cafcdde55a42f747d73f64d59e7839281469346b.tar.gz
elgg-cafcdde55a42f747d73f64d59e7839281469346b.tar.bz2
A lighter way to detect if the db has been installed. Fixes #791
git-svn-id: https://code.elgg.org/elgg/trunk@2826 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--engine/lib/install.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/engine/lib/install.php b/engine/lib/install.php
index e9ae5279b..9709e95e2 100644
--- a/engine/lib/install.php
+++ b/engine/lib/install.php
@@ -66,11 +66,11 @@
if (isset($CONFIG->db_installed)) {
return $CONFIG->db_installed;
}
-
- $tables = get_db_tables();
- if (!$tables) {
- return false;
- }
+
+ if ($dblink = get_db_link('read')) {
+ mysql_query("select * from {$CONFIG->dbprefix}entities limit 1",$dblink);
+ if (mysql_errno($dblink) > 0) return false;
+ } else return false;
$CONFIG->db_installed = true; // Set flag if db is installed (if false then we want to check every time)