From 17fca61d112f76a3f9c69be39eb1e8c252c95965 Mon Sep 17 00:00:00 2001 From: kink Date: Thu, 1 Jul 2004 12:12:07 +0000 Subject: [PATCH] Be a bit more verbose in the error message about PEAR not being included: give a pointer as to what might be the problem (also in configtest). Small cosmetic fixes in configtest. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@7715 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/abook_database.php | 2 ++ functions/db_prefs.php | 2 ++ src/configtest.php | 20 +++++++++++++------- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/functions/abook_database.php b/functions/abook_database.php index f7b79a38..82ddba9d 100644 --- a/functions/abook_database.php +++ b/functions/abook_database.php @@ -37,8 +37,10 @@ if (!include_once('DB.php')) { // same error also in db_prefs.php require_once(SM_PATH . 'functions/display_messages.php'); $error = _("Could not include PEAR database functions required for the database backend.") . "
\n"; + $error .= _("Is PEAR installed, and is the include path set correctly to find DB.php?") . "
\n"; $error .= _("Please contact your system administrator and report this error."); error_box($error, $color); + exit; } /** diff --git a/functions/db_prefs.php b/functions/db_prefs.php index 981177b8..12b26d94 100644 --- a/functions/db_prefs.php +++ b/functions/db_prefs.php @@ -41,8 +41,10 @@ if (!include_once('DB.php')) { // same error also in abook_database.php require_once(SM_PATH . 'functions/display_messages.php'); $error = _("Could not include PEAR database functions required for the database backend.") . "
\n"; + $error .= _("Is PEAR installed, and is the include path set correctly to find DB.php?") . "
\n"; $error .= _("Please contact your system administrator and report this error."); error_box($error, $color); + exit; } global $prefs_are_cached, $prefs_cache; diff --git a/src/configtest.php b/src/configtest.php index f60b67ab..a0ff7de4 100644 --- a/src/configtest.php +++ b/src/configtest.php @@ -70,9 +70,11 @@ if(!in_array('strings.php', $included)) { /* checking PHP specs */ -echo '

SquirrelMail version: '.$version.'
'. - 'Config file version: '.$config_version . '
'. - 'Config file last modified: '.date ('d F Y H:i:s', filemtime(SM_PATH . 'config/config.php')).'

'; +echo "

\n\n" . + '\n" . + '\n
SquirrelMail version:" . $version . "
Config file version:' . $config_version . "
Config file last modified:' . + date ('d F Y H:i:s', filemtime(SM_PATH . 'config/config.php')) . + "
\n

\n\n"; echo "Checking PHP configuration...
\n"; @@ -80,7 +82,7 @@ if(!check_php_version(4,1,0)) { do_err('Insufficient PHP version: '. PHP_VERSION . '! Minimum required: 4.1.0'); } -echo $IND . 'PHP version '.PHP_VERSION.' OK.
'; +echo $IND . 'PHP version ' . PHP_VERSION . " OK.
\n"; $php_exts = array('session','pcre'); $diff = array_diff($php_exts, get_loaded_extensions()); @@ -88,7 +90,7 @@ if(count($diff)) { do_err('Required PHP extensions missing: '.implode(', ',$diff) ); } -echo $IND . 'PHP extensions OK.
'; +echo $IND . "PHP extensions OK.
\n"; /* checking paths */ @@ -236,7 +238,7 @@ fclose($stream); echo $IND . 'IMAP server OK ('. htmlspecialchars(trim($imapline)).")
\n"; -echo "Checking internationalization (i18n) settings:
\n"; +echo "Checking internationalization (i18n) settings...
\n"; echo "$IND gettext - "; if (function_exists('gettext')) { echo "Gettext functions are available. You must have appropriate system locales compiled.
\n"; @@ -325,7 +327,9 @@ if($addrbook_dsn || $prefs_dsn || $addrbook_global_dsn) { } } } else { - do_err('Required PHP Pear DB support is not available.');; + do_err('Required PHP PEAR DB support is not available. Is PEAR installed and is the + include path set correctly to find DB.php? The include path is now: + "' . ini_get('include_path') . '".'); } } else { echo $IND."not using database functionality.
\n"; @@ -338,3 +342,5 @@ if($addrbook_dsn || $prefs_dsn || $addrbook_global_dsn) { +