summaryrefslogtreecommitdiff
path: root/test.php
diff options
context:
space:
mode:
authorSavetheinternet <savetheinternet@n0v4.com>2010-12-01 21:39:34 +1100
committerPaul Merrill <napalminc@gmail.com>2010-12-01 02:54:18 -0800
commita1c77c3d177c3b79eb4d4627fd1948a203e54b25 (patch)
treeb5a65d76500f78bcc807214b62c1b943be81c11b /test.php
parent2dcc1d96db7543515ca73885a7d751e1f4068e8c (diff)
Fixed bug suppressing any output when mysql is not installed/enabled.
(cherry picked from commit 9f9861ad204ec84721930fb3bd86a064765c51c3)
Diffstat (limited to 'test.php')
-rw-r--r--test.php22
1 files changed, 12 insertions, 10 deletions
diff --git a/test.php b/test.php
index 06249c38..7da4506b 100644
--- a/test.php
+++ b/test.php
@@ -43,19 +43,21 @@
// Database
title('Database');
- if($sql = @mysql_connect(MY_SERVER, MY_USER, MY_PASSWORD)) {
- $body .= check('Connection to server.', 'ok');
- if(@mysql_select_db(MY_DATABASE, $sql))
- $body .= check('Select database.', 'ok');
- else {
- $body .= check('Select database.', 'error');
+ if(extension_loaded('mysql')) {
+ if($sql = @mysql_connect(MY_SERVER, MY_USER, MY_PASSWORD)) {
+ $body .= check('Connection to server.', 'ok');
+ if(@mysql_select_db(MY_DATABASE, $sql))
+ $body .= check('Select database.', 'ok');
+ else {
+ $body .= check('Select database.', 'error');
+ $todo[] = 'instance-config.php: Check database configuration.';
+ }
+ } else {
+ $body .= check('Connection to server.', 'error');
$todo[] = 'instance-config.php: Check database configuration.';
}
- } else {
- $body .= check('Connection to server.', 'error');
- $todo[] = 'instance-config.php: Check database configuration.';
}
-
+
// Configuration
title('Configuration');
$root = dirname($_SERVER['REQUEST_URI']) . (dirname($_SERVER['REQUEST_URI']) == '/' ? '' : '/');